Unexpected end-of-file ... @ error/miff.c/ReadMIFFImage/1581

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
yury-n
Posts: 2
Joined: 2013-08-16T15:13:09-07:00
Authentication code: 6789

Unexpected end-of-file ... @ error/miff.c/ReadMIFFImage/1581

Post by yury-n »

We received several tickets from our users who have issues with their uploads.
e.g.
https://dl.dropboxusercontent.com/u/181 ... iginal.jpg
https://dl.dropboxusercontent.com/u/181 ... ginal2.jpg
When an image is passed through MIFF it is split in half and reversed. also it seems that its color palette is corrupted.
https://dl.dropboxusercontent.com/u/18135830/result.jpg

the code to reproduce:

Code: Select all

nice convert 'original.jpg' -strip miff:- | nice convert -shave 0x1 - JPG:'result.jpg'
the error I get:
convert: unexpected end-of-file `/tmp/magick-40742w1bAEvaqMoPk': No such file or directory @ error/miff.c/ReadMIFFImage/1581

Version: ImageMagick 6.8.6-8 2013-08-11 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: jng jpeg png ps zlib


Thanks a lot!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Unexpected end-of-file ... @ error/miff.c/ReadMIFFImage/

Post by fmw42 »

nice convert 'original.jpg' -strip miff:- | nice convert -shave 0x1 - JPG:'result.jpg'
I do not know if this is going to help, but the image should really be read before the shave

nice convert 'original.jpg' -strip miff:- | nice convert - -shave 0x1 JPG:'result.jpg'

Color shifts are often due to CMYK jpg. But your images are sRGB. I tried with IM 6.8.6.8 Q16 Mac OSX and got an error message

convert original.jpg -strip miff:- | convert - -shave 0x1 JPG:result.jpg

convert: unexpected end-of-file `/var/tmp/magick-59852bFDSkRfoaf': Bad file descriptor @ error/miff.c/ReadMIFFImage/1581.


convert original.jpg -strip miff:- | convert - -shave 0x1 result.jpg

convert: unexpected end-of-file `/var/tmp/magick-601LsiBsSpbW1EZ': Bad file descriptor @ error/miff.c/ReadMIFFImage/1581.

I also tried just saving to miff and it appears from the -verbose information that the -strip is not working fully. It leaves some bad data there in the properties section.

Code: Select all

  Properties:
    B<B
CEHCPD AG
R: 2
O<
    date:create: 2013-08-16T16:57:49-07:00
    date:modify: 2013-08-16T16:57:49-07:00
    exif:thumbnail:ResolutionUnit: 2
    exif:thumbnail:XResolution: 72/1
    exif:thumbnail:YResolution: 72/1
    G?
      IG?
         KCA>:E==5?<
    jpeg:colorspace: 2
    jpeg:sampling-factor: 2x2,1x1,1x1
    MicrosoftPhoto:DateAcquired: 2013-07-02T21:36:17.867
    PMYUVR
TSZ`[d\e[cU]
            R^Rc
RW	QNX	OWSX
  QS
    RT
EB: /><*8M5ES7FS4DS4DO3BL1@M7DJ3CS;IP8FL1@O4CS7FQ5CU6EY:IT5DG+9U9HV;JJ2@K4DI2BG2AP4CP5DL4AI3?G1=I3?M7DN6DI1AH0@G0@N7GQ=IP<HU?KWAMDFUMWa?RX8KOCUYHW^>OY8KY8J^4D[;Ja=Oc6M[=TFX?JL==?>9=@7<A29A.4D-5F,5C,4A,3@-17'*8),C47B36:+0=,28(+3#&<,/>.16&)6'*;,/9*-7(-;/3=153'+0#*9,38-36+1/")0#*3'+4(,4(,/#'*".#'-"&.#'1&*-$'*!$,#&-$'0'*.!(+
    QM
      SO	UQa\`\	_\miljjhkiig	d_
c_kgic\_W
D?IDKAOCL=RGRL  `PePdJW6: 
    rdf:Bag: 
xmp:CreatorTool={Microsoft
    signature: 338e216b1ec5c3d34cc810ee8772dfec5a5315cbd5cd9bbb6f76c23c555ac984
    Windows Photo Viewer 6.1.7600.16385}


:
UhQfQh
UlNcP`J[JOcJ^Mc
               Xoe?e?
                     ]?b?h?f?g?"s?h?&w?"u?r?p?"s?o?+|?3??0?#s?l?'x?*|?#y?#{?#?{?{?}?u?w?x?{???????????
                      ??: B8

convert original.jpg -strip original.miff

identify -verbose original.miff


So something does appear to be wrong here.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Unexpected end-of-file ... @ error/miff.c/ReadMIFFImage/

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.6-9 Beta available by sometime tomorrow. Thanks.
yury-n
Posts: 2
Joined: 2013-08-16T15:13:09-07:00
Authentication code: 6789

Re: Unexpected end-of-file ... @ error/miff.c/ReadMIFFImage/

Post by yury-n »

tested on 6.8.6-9 and can confirm it doesn't happen anymore.
thank you!
Post Reply