AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
March 2010

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2010.03.16 19:45 "TIFFVStripSize overflow, JPEG decoding", by Lee Cooper
2010.03.16 21:08 "Re: TIFFVStripSize overflow, JPEG decoding", by Bob Friesenhahn
2010.03.17 20:19 "Re: TIFFVStripSize overflow, JPEG decoding", by Adam Goode
2010.03.17 21:36 "Re: TIFFVStripSize overflow, JPEG decoding", by Tom Lane
2010.03.18 00:11 "Re: TIFFVStripSize overflow, JPEG decoding", by Adam Goode
2010.03.16 22:34 "Re: TIFFVStripSize overflow, JPEG decoding", by Lee Cooper
2010.03.17 16:42 "Re: TIFFVStripSize overflow, JPEG decoding", by Jason Summers
2010.03.17 20:18 "Re: TIFFVStripSize overflow, JPEG decoding", by Adam Goode
2010.03.17 20:59 "Re: TIFFVStripSize overflow, JPEG decoding", by Lee Cooper
2010.03.18 00:15 "Re: TIFFVStripSize overflow, JPEG decoding", by Adam Goode
2010.03.18 02:40 "Re: TIFFVStripSize overflow, JPEG decoding", by Olivier Paquet
2010.03.19 15:52 "Re: TIFFVStripSize overflow, JPEG decoding", by Adam Goode
2010.03.19 16:39 "Re: TIFFVStripSize overflow, JPEG decoding", by Bob Friesenhahn
2010.03.19 18:18 "Re: TIFFVStripSize overflow, JPEG decoding", by Adam Goode
2010.03.19 23:43 "Re: TIFFVStripSize overflow, JPEG decoding", by Bob Friesenhahn

2010.03.17 16:42 "Re: TIFFVStripSize overflow, JPEG decoding", by Jason Summers

Lee Cooper wrote:
> Thank you Bob, Ed, for pointing out the limits on JPEG size.
>
> In light of this fact I think the file may be more complex than I
> expected.  The example I listed is actually on the small side and I
> am certain that typical examples cannot be contained within the
> limits you mention.  Looking at tiffdump output for a larger file
> (listed below) I see unlabeled tags with array values.  I'm guessing
> these are pointers into multiple separate JPEGs.  I cannot be sure
> however because the manufacturer's documentation is still not
> available.
>
> Supposing I have a pointer to a region of the file that contains an
> encoded JPEG, and the size of the region in bytes, is there a simple
> way to decode this region?

> ImageWidth (256) LONG (4) 1<159744>
> ImageLength (257) LONG (4) 1<109824>
> RowsPerStrip (278) LONG (4) 1<109824>

So far as I know, JPEG image dimension fields are always 16-bit 
integers, for a maximum dimension of 65535 pixels. You have an alleged 
JPEG image that exceeds that, so something fishy is going on.

I think you're on the right track, that this is a nonstandard format, 
and that the JPEG strip actually contains multiple JPEG images. I think 
there's a reasonable chance that you could extract the images using 
libjpeg, by first seeking to their starting positions in the TIFF file. 
But finding those starting positions will require reverse engineering, 
or documentation.

Note that after decompression, the strip will be extremely large, over 
4GB. Libtiff usually decompresses each strip in its entirety to memory, 
so even if libtiff supported the format, you might well run into a 
limitation somewhere. (For example, it obviously wouldn't work on a 
32-bit system.)

-- 
Jason Summers