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.
possible bug PAM format output IM 6.8.5.6 Mac OSX
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
possible bug PAM format output IM 6.8.5.6 Mac OSX
Last edited by fmw42 on 2013-05-23T20:15:22-07:00, edited 2 times in total.
Re: possible bug PAM format output IM 6.8.5.6 Mac OSX
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug PAM format output IM 6.8.5.6 Mac OSX
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
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
Looks like it doesn't like the image comment. We'll add a patch by sometime tomorrow.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug PAM format output IM 6.8.5.6 Mac OSX
No rush on this. Just wanted to understand what was going on. Thanksmagick wrote:Looks like it doesn't like the image comment. We'll add a patch by sometime tomorrow.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: possible bug PAM format output IM 6.8.5.6 Mac OSX
Actually that is PbmPlus 'comment' and probably should be preserved in IM as a possible multi-line 'comment'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug PAM format output IM 6.8.5.6 Mac OSX
This problem appears to be fixed in IM 6.8.5.7 Q16 Mac OSX Snow Leopard
Thanks
Thanks
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: [RESOLVED] possible bug PAM format output IM 6.8.5.6 Mac
Agreed. but not quite right when multi-line comments are used.
generate a multi-line comment -- GOOD
Read with multi-line comment -- BAD
It has lost the newline between the words!
It should have come out like this
generation also fails to preserve a newline on the end of a comment
That last is valid PbmPlus format (binary (compressed) form is also valid), just does not preserve the final newline in comment quite right.
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
Code: Select all
convert -comment "hi\nthere" xc: ppm:- | convert - -print "%c\n" null:
hithere
It should have come out like this
Code: Select all
convert -comment "hi\nthere" xc: -print "%c\n" null:
hi
there
Code: Select all
convert -comment "hi\nthere\n" xc: -compress none ppm:-
P3
#hi
#there
1 1
65535
65535 65535 65535
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: possible bug PAM format output IM 6.8.5.6 Mac OSX
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.5-8 Beta available by sometime tomorrow. Thanks.