Page 1 of 1

possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-18T17:56:26-07:00
by fmw42
I am having trouble converting this file to pam format (http://en.wikipedia.org/wiki/File:Barns ... tetons.jpg)

convert Barns_grand_tetons.jpg barn.pam

identify barn.pam
identify: negative or zero image size `barn.pam' @ error/pnm.c/ReadPNMImage/417.

However, if I strip the profiles, it works fine.

convert Barns_grand_tetons.jpg -strip barn2.pam

identify barn2.pam
barn2.pam PAM 800x598 800x598+0+0 8-bit TrueColor sRGB 1.435MB 0.000u 0:00.000


Perhaps NetPBM formats should automatically strip the profile if that is a problem or IM should give a warning or error message when trying to write the file.

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-18T18:52:59-07:00
by magick
We cannot reproduce the problem. The PAM file created by 6.8.5-6 is correct for us. Its header looks like this:
  • P7
    WIDTH 1600
    HEIGHT 1195
    DEPTH 3
    MAXVAL 255
    TUPLTYPE RGB
    ENDHDR

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-18T19:14:54-07:00
by fmw42
I downloaded it again and tried and got the same error message. Perhaps it is an issue only to the Mac OS?

I can open the file in my text editor and it shows:


P7
#File source: http://commons.wikimedia.org/wiki/File: ... tetons.jpg
WIDTH 800
HEIGHT 598
DEPTH 3
MAXVAL 255
TUPLTYPE RGB
ENDHDR


followed by data.

But identify still gives the same error message

CORRECTION:

If I download the full size file rather than pull the displayed image, it works fine.

try this file, which is the smaller one

http://www.fmwconcepts.com/misc_tests/p ... tetons.jpg

convert 800px-Barns_grand_tetons.jpg barn.pam

identify barn.pam
identify: unable to open image `barn.jpg': No such file or directory @ error/blob.c/OpenBlob/2644.


It may just be some corruption in the jpg, though it displays fine.

Note it works fine even with the last image if I remove the meta data via -strip

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-18T20:00:06-07:00
by magick
Looks like it doesn't like the image comment. We'll add a patch by sometime tomorrow.

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-18T20:56:21-07:00
by fmw42
magick wrote:Looks like it doesn't like the image comment. We'll add a patch by sometime tomorrow.
No rush on this. Just wanted to understand what was going on. Thanks

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-21T22:54:01-07:00
by anthony
Actually that is PbmPlus 'comment' and probably should be preserved in IM as a possible multi-line 'comment'.

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-23T18:27:51-07:00
by fmw42
This problem appears to be fixed in IM 6.8.5.7 Q16 Mac OSX Snow Leopard

Thanks

Re: [RESOLVED] possible bug PAM format output IM 6.8.5.6 Mac

Posted: 2013-05-23T19:40:21-07:00
by anthony
Agreed. but not quite right when multi-line comments are used.

generate a multi-line comment -- GOOD

Code: Select all

convert -comment "hi\nthere" xc: -compress none ppm:-P3
#hi
#there
1 1
65535
65535 65535 65535 
Read with multi-line comment -- BAD

Code: Select all

convert -comment "hi\nthere" xc: ppm:- | convert - -print "%c\n" null:
hithere
It has lost the newline between the words!

It should have come out like this

Code: Select all

convert -comment "hi\nthere" xc: -print "%c\n" null:
hi
there
generation also fails to preserve a newline on the end of a comment

Code: Select all

convert -comment "hi\nthere\n" xc: -compress none ppm:-
P3
#hi
#there

1 1
65535
65535 65535 65535 
That last is valid PbmPlus format (binary (compressed) form is also valid), just does not preserve the final newline in comment quite right.

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Posted: 2013-05-24T08:46:24-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.5-8 Beta available by sometime tomorrow. Thanks.