AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2012.07.11 20:52 "[Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Jorge Martin
2012.07.11 21:35 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Bob Friesenhahn
2012.07.11 23:47 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Olivier Paquet
2012.07.12 09:44 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Joris Van Damme
2012.07.12 09:57 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Jorge Martin
2012.07.12 10:10 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Joris Van Damme
2012.07.12 10:17 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Jorge Martin
2012.07.12 11:17 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Joris Van Damme
2012.07.12 20:22 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Jorge

2012.07.11 21:35 "Re: [Tiff] Doubts about Strip and Tile Oriented read/write TIFF files", by Bob Friesenhahn

       I have an important doubt about how tile/strip oriented TIFF images have to be read/written. As I know, not all the tiles/strips are full of data because the rowPerStrip/TileSize is not multiple of the size of the image. I understand that the strip/tile that are not full of data, will be filled with 0s by libtiff when the Tile/Strip are read. And this Strip/Tile should be filled with 0s before call to libtiff (TIFFWriteEncodedStrip/TIFFWriteEncodedTile). Are these

> assumptions correct? 

I think so. Tiles are always full rectangles even if they refer to

unused area.

>        I have implemented the code pasted below to read tile-oriented image, but I do not know how to manage the Tiles

that are not full of data (border tile), because I need to return a buffer (m_TiffValuesVec->at(dirIdx).tiffBuffer) with

> only data. 

You will need to copy from the tile into your own representation if

you don't want to preserve the unused tile portion.

Feel free to refer to GraphicsMagick's TIFF code for an example

(seached for "TiledMethod"):

http://graphicsmagick.hg.sourceforge.net/hgweb/graphicsmagick/graphicsmagick/file/cd958baa618c/coders/tiff.c

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/