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

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
user001
Posts: 30
Joined: 2015-11-02T01:21:03-07:00
Authentication code: 1151

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

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
user001
Posts: 30
Joined: 2015-11-02T01:21:03-07:00
Authentication code: 1151

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

Post by user001 »

That was very fast, thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
user001
Posts: 30
Joined: 2015-11-02T01:21:03-07:00
Authentication code: 1151

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

Post 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
user001
Posts: 30
Joined: 2015-11-02T01:21:03-07:00
Authentication code: 1151

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

Post by user001 »

I can confirm that the patch worked. Thanks again!
Post Reply