
On 24 February 2013 21:07, Christian Henning <chhenning@gmail.com> wrote:
Skipping can be different for different formats. jpeg for instance still reads the scanline when skipping. For now, I think, we are good.
Sure that makes sense, but the interface lies IMO. If I have jpeg and I call skip( buffer, 0 ) it's not going to be skipping over scanline 0 (unless it happens to be the first call to read/skip), it's just skipping forward one scanline, the second parameter is unused.
Similarly the TIFF reader seems to read skipped scanlines unnecessarily as skip forwards to read but the TIFF interface supports reading any scanline you want directly with TIFFReadScanline.
As far as I can tell tiff needs the row number to be read and also tiff rows cannot be read in random order.
It's not precise, because rows of some TIFFs can be accessed in random order. The spec confirms that too: "random access to individual scanlines can only be provided when data is not stored in a compressed format, or when the number of rows in a strip of image data is set to one (RowsPerStrip is one)." http://www.remotesensing.org/libtiff/libtiff.html Best regards, -- Mateusz Loskot, http://mateusz.loskot.net