Page 1 of 1

display-im6.q16: unexpected end-of-file on miff files

Posted: 2017-11-23T12:29:55-07:00
by user001
Conversion to miff fails on some images, such as this one: https://ufile.io/2v40w

This works fine:

Code: Select all

convert a.tif -depth 8 -colorspace gray PNG:- | display -
whereas this fails:

Code: Select all

convert a.tif -depth 8 -colorspace gray miff:- | display -
The error is:

Code: Select all

display-im6.q16: unexpected end-of-file `/tmp/magick-18299r_gUYwVHKpo': No such file or directory @ error/miff.c/ReadMIFFImage/1621.
Even if the image is first converted to a PNG, the error still results when attempting to convert to miff:

Code: Select all

convert a.tif -depth 8 -colorspace gray PNG:- | convert - miff:- | display -
The error is image-specific, as it does not occur on other images.

System details:

debian 9.2
linux 4.9.0-4-amd64

Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib

Thanks for looking into this.

Re: display-im6.q16: unexpected end-of-file on miff files

Posted: 2017-11-23T12:37:40-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: display-im6.q16: unexpected end-of-file on miff files

Posted: 2017-11-23T13:17:45-07:00
by user001
That was very fast, thanks!

Re: display-im6.q16: unexpected end-of-file on miff files

Posted: 2017-11-23T13:30:50-07:00
by fmw42
FYI: I downloaded your tiff file. But Preview on my Mac will not open it. Also when I open in GIMP, the file opens but I get several messages.

GIMP Message
Calling error for procedure 'gimp-image-set-resolution':
Image resolution is out of bounds, using the default resolution instead.

TIFF image Message
Sorry, can not handle images with 64-bit samples

TIFF image Message
Unsupported layout, no RGBA loader

Re: display-im6.q16: unexpected end-of-file on miff files

Posted: 2017-11-23T13:42:25-07:00
by user001
Yes, it's a 64-bit tiff, so the majority of image viewers fail to open it. The resolution is 65 nm/px, expressed as cm^-1 (TiffTag RESUNIT_CENTIMETER = 3, https://www.awaresystems.be/imaging/tif ... nunit.html). The resolution shouldn't matter to an image viewer. I'm not sure about the RGBA loader complaint. It's a valid tiff as far as I can tell (header and pixel data).

Code: Select all

$ tiffinfo a.tif
TIFF Directory at offset 0x17078 (94328)
  Image Width: 90 Image Length: 131
  Resolution: 153848, 153848 pixels/cm
  Bits/Sample: 64
  Sample Format: IEEE floating point
  Compression Scheme: None
  Photometric Interpretation: min-is-black
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 1
  Rows/Strip: 1
  Planar Configuration: single image plane

Re: display-im6.q16: unexpected end-of-file on miff files

Posted: 2017-11-23T16:03:58-07:00
by user001
I can confirm that the patch worked. Thanks again!