crash with "new JPEG in TIF" file in 6.6.4-2-Q16

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
tilman
Posts: 19
Joined: 2010-09-15T03:23:33-07:00
Authentication code: 8675308
Location: Berlin, Germany

crash with "new JPEG in TIF" file in 6.6.4-2-Q16

Post by tilman »

Hello,

convert crash.tif test.pbm

crashes with 6.6.4-2-Q16 on XP, this is a "new JPEG in TIF" format.
It worked fine with 6.6.3-7-Q16. This happens also with imdisplay.

The file is here:
http://ul.to/j23pbi

Tilman Hausherr
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: crash with "new JPEG in TIF" file in 6.6.4-2-Q16

Post by fmw42 »

I think your file may be corrupted or have some special "feature" as I cannot open it with other tools on my Mac such as Preview. Photoshop opens it. In one tool I get an error message that it cannot handle compression 7.

Exiftool says:


exiftool -s -ee -g1 -u -n -D crash.tif
---- ExifTool ----
- ExifToolVersion : 8.24
---- System ----
- FileName : crash.tif
- Directory : .
- FileSize : 129192
- FileModifyDate : 2010:09:15 03:36:07-07:00
- FilePermissions : 644
---- File ----
- FileType : TIFF
- MIMEType : image/tiff
- ExifByteOrder : II
---- IFD0 ----
254 SubfileType : 0
256 ImageWidth : 1656
257 ImageHeight : 2320
258 BitsPerSample : 8 8 8
259 Compression : 7
262 PhotometricInterpretation : 6
273 StripOffsets : 768
274 Orientation : 1
277 SamplesPerPixel : 3
278 RowsPerStrip : 2320
279 StripByteCounts : 128424
282 XResolution : 200
283 YResolution : 200
284 PlanarConfiguration : 1
296 ResolutionUnit : 2
305 Software : Kofax standard Multi-Page TIFF Storage Filter v3.03.000
306 ModifyDate : 2010:09:15 11:33:17
513 OtherImageStart : 768
33000 Exif_0x80e8 : 0
---- Composite ----
- ImageSize : 1656x2320


Tiff compression 7 is JPEG ('new-style' JPEG).

Perhaps it is not creating compression 7 correctly?

P.S. I don't really know, but perhaps there is some connection between this bug report and viewtopic.php?f=3&t=17065#p63446
User avatar
tilman
Posts: 19
Joined: 2010-09-15T03:23:33-07:00
Authentication code: 8675308
Location: Berlin, Germany

Re: crash with "new JPEG in TIF" file in 6.6.4-2-Q16

Post by tilman »

fmw42 wrote:I think your file may be corrupted or have some special "feature" as I cannot open it with other tools on my Mac such as Preview. Photoshop opens it. In one tool I get an error message that it cannot handle compression 7.
Many tools have trouble displaying JPEG in TIFF .tif files. Some can't handle the new format, some can't handle the old format. The XP viewer can't do the new format. The W7 viewer can do both most of the times. The only tool that has handled everything in more than a decade is IrfanView. And yes, my file is compression 7.
fmw42 wrote:P.S. I don't really know, but perhaps there is some connection between this bug report and viewtopic.php?f=3&t=17065#p63446
Yes, there is definitively a connection. The author is the same :-)

Tilman Hausherr
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: crash with "new JPEG in TIF" file in 6.6.4-2-Q16

Post by fmw42 »

Yes, there is definitively a connection. The author is the same
Sorry Tilman, I had not noticed. :oops: But hopefully this also will be fixed then in 6.6.4.3
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: crash with "new JPEG in TIF" file in 6.6.4-2-Q16

Post by Drarakel »

The main problem (the image is not readable) could be a libtiff issue.(?)
But the crash in ImageMagick probably should be fixed, yes..

Some additional details:
The crash in Windows happens in the JPG module (core_rl_jpeg_.dll).
And my (rather old) standalone version of libtiff reports these errors (apart from the 'unknown tags' warnings):

Code: Select all

JPEGLib: Warning, Application transferred too many scanlines.
crash.TIF: Error, can't read strip 0.
Maybe someone can check it with a new libtiff version?

Perhaps a missing YCbCrSubSampling tag causes this crash. (Would be strange though, as there are YCbCr images without a correct tag that can get read in IM - with just a warning IIRC. But these were Old JPG in TIFFs, I think..)
Anyway, the above file uses 2x2 subsampling. And when the YCbCrSubSampling tag is added, the crash in IM is gone. Take this version with modified tags:
nocrash.TIF (Link deleted)
But even then, the image can't be read with IM/libtiff (one gets a black image). The IM error message then says:

Code: Select all

Magick: fractional scanline not read. `crash3.TIF' @ warning/tiff.c/TIFFWarnings/704.
Maybe libtiff doesn't treat correctly the 2x2 subsampling in TIFF and treats it somehow as if it had no (=1x1) subsampling? But that's just speculation..
Last edited by Drarakel on 2010-09-25T23:45:56-07:00, edited 1 time in total.
User avatar
tilman
Posts: 19
Joined: 2010-09-15T03:23:33-07:00
Authentication code: 8675308
Location: Berlin, Germany

Re: crash with "new JPEG in TIF" file in 6.6.4-2-Q16

Post by tilman »

Bug is fixed in the 6.6.4-3 beta version (static build). Thanks!
Post Reply