possible bug PAM format output IM 6.8.5.6 Mac OSX

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
User avatar
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

Post 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.
Last edited by fmw42 on 2013-05-23T20:15:22-07:00, edited 2 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Post 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
User avatar
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

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

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Post by magick »

Looks like it doesn't like the image comment. We'll add a patch by sometime tomorrow.
User avatar
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

Post 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
User avatar
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

Post by anthony »

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/
User avatar
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

Post by fmw42 »

This problem appears to be fixed in IM 6.8.5.7 Q16 Mac OSX Snow Leopard

Thanks
User avatar
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

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug PAM format output IM 6.8.5.6 Mac OSX

Post 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.
Post Reply