AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2000.10.06 15:07 "PDF is NOT proprietary!", by Leonard Rosenthol
2000.10.06 16:13 "RE: PDF is NOT proprietary!", by Ed Grissom
2000.10.06 16:32 "RE: PDF is NOT proprietary!", by Leonard Rosenthol
2000.10.06 16:35 "RE: PDF is NOT proprietary!", by Ed Grissom
2000.10.27 08:24 "Re: Write tags", by Klaus Bartz
2000.10.26 14:44 "Re: Write tags", by Markus Neifer
2000.10.26 18:50 "Re[2]: Write tags", by Rainer Wiesenfarth
2000.10.27 08:46 "Re: Write tags", by Markus Neifer
2000.10.27 09:06 "Re: Write tags", by Markus Neifer
2000.10.06 20:10 "RE: PDF is NOT proprietary!", by Bo Yang
2000.10.06 20:41 "RE: PDF is NOT proprietary!", by Ed Grissom
2000.10.06 21:02 "Re: PDF is NOT proprietary!", by Larry Jones
2000.10.06 21:35 "Re: PDF is NOT proprietary!", by Alex
2000.10.08 00:24 "Re: PDF is NOT proprietary!", by Leonard Rosenthol

2000.10.27 08:24 "Re: Write tags", by Klaus Bartz

Hello Markus,

it's really difficult to modify an existing IFD.

The story with the SubIFD ( tag 330, defined in TTN1 ) is a little bit other thing. There is an excelent software on the market which copies ( for it ) unknown tags with it's contents to a new file. Pointers also. But the contents of the area to which the offset points not ( theSubIFD is not copied and the resolution reduced child also not ). Only a problem for programms which uses tag 330; but for those the file is corrupted.

It's not a back reference, else a forward reference. No problem if it is in a dead IFD. But if you copy such a tag ( a tag with a offset ) be aware there is a chain ( an offset to an "object" which contains offsets to offsets... ).

References to the old IFD I have seen in a private Tag related too a well known product - it's simple a page offset table for faster access.

You see, there are some reasons why libtiff doesn't do that things...

Klaus

> Hello Markus,
>
> Thursday, October 26, 2000, 4:44:04 PM, you wrote:
>
> MN> Sim Zacks wrote:
> >>
> >> Yes.
> MN> [...]
> MN> Hhm, yes what?
>
> MN> Yes, i have to read all and write then, or
>
> Preferably, yes (see notes below).
>
> MN> Yes, there is sample code
>
> Maybe, but I doubt it. Most users will not need this feature.
>
> What you might do is the following:
>
> - read in the directory you want to change. Be sure to read it
> completely, i.e. read also tags you do not know the meaning of
> - apply your changes to the directory read

> - add two more tags: 'FreeOffsets' and 'FreeByteCount' (I am not sure > about the name and have no TIFF standard laying around here)

> - insert the file offset of the original directoy into FreeOffsets and > the size of the original directory into FreeByteCounts

> - append the new directory to the file but make sure not to write tag > data that is already present in the file (keep this offsets)

> - ah, and of course, if you removed tags that have data stored outside > the directory, be sure to insert these areas of the file into

>   FreeOffsets/FreeByteCounts, too

> - change the pointer to the old directory to point to the new

>   directory and let the new directory point to the old directories'
>   successor
> - oh, there might be other references to the old directory (I think
>   they were called SubIFD or something similar). You will have to
>   change them also. Note that there might be vendor specific tags that
>   contain references to the old directory (bad practice, but we
>   experienced bad practices concerning other topics (e.g. OJPEG))

> -... (maybe more points I missed at the moment)
>

> So, I think libtiff will not help you there. I also doubt that you > will find a solution that is better than quick-and-dirty, i.e. covers

> the most general case.
>

> Thus my recommendation: even if the new directory is the same size as > the old one (i.e. same number of tags), it is better to copy the whole

> file.
>
> Best regards
> Rainer
>
> MN> Regards, Markus
>
> --

--------------------------------------------------------------

> -- Dipl.-Inform. Rainer Wiesenfarth

> -- Inpho GmbH                    E-mail: Rainer.Wiesenfarth@Inpho.de
> -- Smaragdweg 1                  Phone : +49 711 22881-10
> -- 70174 Stuttgart               Fax   : +49 711 22881-11
> -- Germany                       URL   : http://www.inpho.de

>
>
--

-------------------------------------------------------------------
Dr. Klaus Bartz bartzkau@coi.de

COI GmbH / Abt. COI-S   Erlanger Stra�e 62   D-91064 Herzogenaurach

Tel: +49 (9132) 82-3433                        Fax: +49-9132-824959