2016.01.11 11:19 "[Tiff] Problem with TIFFCurrentDirectory", by John Stevenson-Hoare
I am using libtiff version 4.0.6 on Windows 7.
The man pages state that directories are indexed from 0, but when I create a new TIFF and invoke TIFFCurrentDirectory the return value is 65535. Is this a bug?
A simple example is:
TIFF *tif = TIFFOpen("new.tif", "w8");
tdir_t dir = TIFFCurrentDirectory(tif);
My problem is that I need to cache the indexes of directories as I create them so that I can re-visit and update them. If I do this with a file containing 2 directories (both tiled images) the library reports:
'TIFFWriteRawTile: Can not write tiles to a stripped image.'
when I use TIFFSetDirectory(tif, 65535) in an attempt to set the first directory. If I create say 3 directories and 'artificially' assume that indexing starts from 0, then when I set the directory to 0 the library reports:
'new.tif: JPEG compression support is not configured.' when I invoke TIFFWriteRawTile() with a previously compressed JPEG tile.
But the additional tiles are written correctly to the first image.
Oddly, if I create only 2 directories and artificially assume index 0, then I get the error:
'TIFFWriteRawTile: Tile M out of range, max N.' for each tile to be written and the additional tiles are, not unsurprisingly, added to the image.
Any help would be appreciated.
[FFEI_Logo_BoxOnly.png]<http://www.ffei.co.uk> [FFEI wins 3rd Queens award for innovation] <http://www.ffei.co.uk/ffei-wins-third-queens-award-for-innovation/>
CONFIDENTIALITY AND DISCLAIMER NOTICE
This message and any attachment is confidential and is protected by copyright. If you are not the intended recipient, please email the sender and delete this message and any attachment from your system.
Dissemination and or copying of this email is prohibited if you are not the intended recipient. We believe, but do not warrant, that this email and any attachments are virus free. You should take full responsibility for virus checking.
No responsibility is accepted by FFEI Ltd for personal emails or emails unconnected with FFEI Limited's business.
FFEI Limited is a limited company registered in England and Wales (Registered Number: 3244452).
[Join us on Linked In]<http://www.linkedin.com/company/ffei> [Follow @FFEI_ltd] <https://twitter.com/FFEI_ltd> [FFEI YouTube Channel] <http://www.youtube.com/user/FFEIPrintTechnology> Registered Office: The Cube, Maylands Avenue, Hemel Hempstead, Hertfordshire, HP2 7DF, England.