[cairo] 32k limit with image surface?

Bill Spitzak spitzak at gmail.com
Thu Jul 30 11:00:20 PDT 2009


I beg to differ. Tiled TIFF files are a pita to deal with when reading 
them in. They pretty much require the entire image to be read into 
memory before any can be accessed.

Yes in theory they could be random-accessed but that only works if the 
units the program uses is an integer division or multiple of whatever 
tile size the image is using. Needless to say we don't even bother 
checking if this is true as it is false 99.9999% of the time.

Scanline TIFF files do allow random access because we know one dimension 
of the unit is as big as we will ever require, and the other dimension 
is 1, which all possible sizes are a multiple of.

This is based on years of experience doing image processing for Nuke.

Also use PNG as libpng is about a dozen times faster and easier to use 
than libtiff.

M Joonas Pihlaja wrote:
> Hi Ian,
> 
> On Thu, 30 Jul 2009, Ian Britten wrote:
> 
>> To simplify the final processing, I'm trying to tile using just one
>> tile at the desired width, and altering the height to keep the memory
>> use down.  Thus, I'm trying to create image surfaces in the range of
>> 50000 x 1572 (approx 300M), but encountered this issue.
>>
>> [ This approach makes it easier to call things like TIFFWriteScanline(),
>> passing the entire scanline at once, rather than trying to join tiles
>> together, or producing a tiled TIFF, which isn't wanted for this
>> project. ]
> 
> Large scanline oriented TIFFs are a pain to work with in my 
> experience.  Using tiled TIFFs with TIFFWriteTile() is probably easier 
> than using a pseudo-tiling system on top of TIFFWriteScanline().  Of 
> course your final processing determines whether you can do that at 
> all, but there's my 2c anyway. :)
>  
> Joonas
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list