Page 1 of 2
Improper image header
Posted: 2009-10-30T13:48:52-07:00
by jeffATwork
When attempting to convert a pct created by Quicktime 7 Pro, I get
$ convert frame1.pct frame1.jpg
convert: Improper image header `/var/folders/rJ/rJLQE-4XEXqyGP5Q9Q4Mg++++TM/-Tmp-/magick-c9ZU3eZU' @ pict.c/ReadPICTImage/871.
Running Snow Leopard on a MacBook Pro.
I can open the pct file in Photoshop and in 32 bit mode in Preview.
Any ideas?
Thanks!!
Re: Improper image header
Posted: 2009-11-01T19:19:21-07:00
by anthony
That type of error is caused by a failure of the 'delegate' program IM used to convert the image.
More than likely the delegate program ran, but produced a empty or 'unrecognised' output file
Re: Improper image header
Posted: 2009-11-02T06:39:53-07:00
by magick
Post a URL to your image here. We need to download it and reproduce the problem before we can offer a solution.
Re: Improper image header
Posted: 2009-11-02T09:06:04-07:00
by jeffATwork
magick wrote:Post a URL to your image here. We need to download it and reproduce the problem before we can offer a solution.
http://clients.clockwork.net/imagemagick/frame1.pct
Thanks!
Re: Improper image header
Posted: 2009-11-03T07:09:16-07:00
by jeffATwork
Accessing the image seems to be a problem. I'll repost when I figure out what's wrong with the URL.
Re: Improper image header
Posted: 2009-11-03T10:39:07-07:00
by jeffATwork
jeffATwork wrote:
Accessing the image seems to be a problem. I'll repost when I figure out what's wrong with the URL.
The file's there. I was testing accessibility with Safari which got upset about server certification and couldn't download. Use wget or something.
Re: Improper image header
Posted: 2009-11-03T12:02:48-07:00
by magick
We downed loaded the file. There is no readily apparent reason why ImageMagick cannot read the image. It will take some serious debugging to fix the problem. We currently do not have an ETA on when you can expect a patch.
Re: Improper image header
Posted: 2009-11-03T13:07:15-07:00
by fmw42
I don't know if this will be helpful or not. I am on Mac OSX Tiger. I used GraphicConverter to create a pict image in QT format and had no problem using IM to convert it to jpg. Sorry I don't have QT Pro to test.
However, using Preview v3.09 to save to PICT and then using IM to convert to jpg, I get the following error
convert zelda4.pict zelda4_pict.jpg
convert: Improper image header `/var/tmp/magick-OtLYrHQr' @ pict.c/ReadPICTImage/871.
convert -version
Version: ImageMagick 6.5.7-4 2009-11-03 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Here are 3 files, first two from GraphicConverter, convert fine with IM. Last one from Preview, does not convert with IM
http://www.fmwconcepts.com/misc_tests/z ... _noweb.pct
http://www.fmwconcepts.com/misc_tests/z ... qt_web.pct
http://www.fmwconcepts.com/misc_tests/z ... review.pct
Re: Improper image header
Posted: 2009-11-04T14:13:13-07:00
by jeffATwork
magick wrote:We downed loaded the file. There is no readily apparent reason why ImageMagick cannot read the image. It will take some serious debugging to fix the problem. We currently do not have an ETA on when you can expect a patch.
OK.
I just verified that GraphicConverter is able to handle the PICT. So I'll go that route.
Thanks for trying it out.
Re: Improper image header
Posted: 2009-11-04T14:15:35-07:00
by jeffATwork
Yep. That looks like the Tiger version of my problem on Snow Leopard. So, it's been around for a while.
Thanks for giving it a shot!
Re: Improper image header
Posted: 2009-11-04T16:14:20-07:00
by fmw42
Apple must have changed something in the QT format for PICT at some point as GraphicConverter works fine to produce a PICT that IM can convert.
Re: Improper image header
Posted: 2010-07-19T20:28:28-07:00
by jefftrull
I spent some time today debugging a problem of this type. I downloaded and compiled the ImageMagick code so I could add some debug prints to the PICT converter. It looks like my file contained an embedded image, opcode 0x8200. According to coders/pict.c this is an "embedded JPEG", but according to the Apple docs it is "Compressed QuickTime":
http://developer.apple.com/legacy/mac/l ... w-458.html
I then reviewed the QuickTime Image File doc, available here:
http://developer.apple.com/mac/library/ ... -TPXREF101
From that information and some binary dumps I was able to discover that the QuickTime was encapsulating a TIFF image. So this is 1) a TIFF, inside 2) a QuickTime Image, inside 3) a PICT file.
The existing code in pict.c for handling opcode 0x8200 seems to be hardcoded to expect an embedded JPEG, but judging from the Apple docs it can be much more general.
Re: Improper image header
Posted: 2010-07-19T20:46:43-07:00
by jefftrull
Of the three .pct files posted by fmw42, the first two are embedded JPEGs, which explains why ImageMagick can read them OK. The third one seems to be gone, so I can't check it...
Re: Improper image header
Posted: 2011-11-17T13:11:12-07:00
by HanClinto
I'm having similar issues with ImageMagick v. 6.7.3-1 Q17 on OS/X Lion.
Here are three files that Preview reads correctly, but ImageMagick dies on with the aforementioned error:
http://dl.dropbox.com/u/2737199/bugs/Im ... k/xdd.pict
http://dl.dropbox.com/u/2737199/bugs/Im ... k/xad.pict
http://dl.dropbox.com/u/2737199/bugs/Im ... k/xdc.pict
Code: Select all
lappy-i7:ImageMagick clint$ ls
xad.pict xdc.pict xdd.pict
lappy-i7:ImageMagick clint$ mogrify -format png *.pict
mogrify: improper image header `xad.pict' @ error/pict.c/ReadPICTImage/871.
mogrify: improper image header `xdc.pict' @ error/pict.c/ReadPICTImage/868.
mogrify: improper image header `xdd.pict' @ error/pict.c/ReadPICTImage/868.
Re: Improper image header
Posted: 2011-11-17T14:49:47-07:00
by fmw42
For what it is worth. I am on IM 6.7.3.6 Q16 Mac OSX Tiger. I get the following from IM
identify xdd.pict
identify: improper image header `xdd.pict' @ error/pict.c/ReadPICTImage/868.
Preview gives an error message saying it is corrupt.
BUT GraphicConverter opens it fine! If I resave it from GraphicConverter as PICT, then Preview can open it and IM can handle it fine.
So I would say that your image was not created according to Apple's pict standards in some way or the format has changed over time.