2017.09.16 19:50 "[Tiff] TIFF tile size limit", by Bob Friesenhahn

2017.09.16 23:56 "Re: [Tiff] TIFF tile size limit", by Bob Friesenhahn

On 16/09/2017 19:50, Bob Friesenhahn wrote:

Does anyone have an opinion on the maximum tile size which should be allowed by a general purpose TIFF reader?

For example is 4096x4096 large enough to handle any practical TIFFs?

I'd venture to say any size up to and including the full image size.

Technically larger, since the tile size can be larger than the image size. There is nothing to prevent a one pixel image from claiming a huge tile size.

(CL_DEVICE_IMAGE2D_MAX_HEIGHT/WIDTH). So I think it's fair to say that a practical TIFF reader should be capable of at least 8k x 8k for today's basic needs, and likely significantly more to be future proof.

256 MB per tile seems like quite a lot of memory to require from a client.

Regardless, the problem I am seeing here is that the client uses TIFFScanlineSize(), TIFFStripSize(), TIFFTileSize(), or TIFFGetField(tiff,TIFFTAG_IMAGEWIDTH,&width) to determine the amount of memory to allocate. These can return huge sizes and it is difficult for client software to know what sizes are valid.

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