2005.08.09 21:28 "[Tiff] can't create thumbnail of large file", by Boris Filipovič

2005.08.10 00:46 "Re: [Tiff] can't create thumbnail of large file", by Joris Van Damme

Boris Filipoviè wrote:


That's quite a lot.

Are you using the RGBA interface? If so, that explains your need for a complete raster.

Rows/Strip: 1

This particular item here indicates that even with LibTiff, it should be possible to cut down memory needs very substantially.

You need to build yourself a 'scanline stream'. One such design involves a linked list of 'scanline manipulators'. You get scanlines by asking ('pulling') the last manipulator in the list. This one pulls the previous one as needed, etc.

The list you need to set up is the following

    a pre-calculated resampling map of 140000 weights, say 16bits per weight,
all depending on implementation: 280000 bytes
- result thumbnail writer
    one 8bit per pixel scanline of 200 pixels = 200 bytes
    one 8bit per pixels result thumbnail memory block of 200x200 pixels = 40000

So, even assuming the most ridiculously stupid of implementations of this particular 'scanline stream' scheme, with loads of duplication and stuff, this amounts to only 587256 bytes, is about half a meg.

Means even handling of images this big is quite feasable, but avoid temp buffers, especially the kind you get from TIFFRGBA interface costing 32bits for each 1bits pixel in the huge source image...

Joris Van Damme
Download your free TIFF tag viewer for windows here: