Page 1 of 1
Crash with PNG8 output
Posted: 2011-02-23T17:23:19-07:00
by Drarakel
That command gives me a crash (in the PNG module):
Code: Select all
convert rose: -define png:color-type=3 rosec.png
The same with "PNG8:rosec.png" instead of the define. Using IM v6.6.7-9 Q16, on Windows XP.
Can someone reproduce that?
Of course, that's not a very reasonable command, but a crash probably should be avoided. Older IM versions reduce the image to 256 colors, or give me a "Valid palette required for paletted images" error with such commands - but not a crash.
Re: Crash with PNG8 output
Posted: 2011-02-23T18:58:46-07:00
by glennrp
Yes, it crashes when it tries to copy a non-existent colormap.
Verified that SVN head has this failure. Fixed in SVN r3717 and
will be in ImageMagick-6.6.7-10.
Re: Crash with PNG8 output
Posted: 2011-02-26T11:05:45-07:00
by Drarakel
The crash is gone. Thanks!
But the current behaviour in IM v6.6.7-10 still puzzles me a bit. An implicit color reduction is now done if necessary - right?. But...
Code: Select all
convert -verbose rose: -define png:color-type=3 test.png
ROSE PPM 70x46 70x46+0+0 8-bit DirectClass 9.67KB 0.000u 0:00.000
rose:=>ROSE ROSE 70x46 70x46+0+0 8-bit DirectClass 9.67KB 0.000u 0:00.000
rose:=>test.png ROSE 70x46 70x46+0+0 8-bit DirectClass 0.016u 0:00.016
No error, return code 0 - but test.png is a
0 byte file.
And the PNG8 command behaves differently now:
'Working' PNG file - but with an (almost) black image. Is it supposed to be like that?
(An older IM installation - e.g. v6.5.8-5 - produces no file with such a combination and gives an "Invalid number of colors in palette" error message instead. And, as mentioned, with the 'color-type command', one got a "valid palette required" error.)
Re: Crash with PNG8 output
Posted: 2011-02-26T12:51:06-07:00
by glennrp
The Q8 works OK but the Q16 is using a palette that is shifted down
by 8 bits. I thought I had fixed that but obviously didn't. Sorry, will fix
again. Thanks for the report.
Re: Crash with PNG8 output
Posted: 2011-02-26T14:16:27-07:00
by glennrp
The scaling down to black should be working now, SVN r3751 (IM-6.6.8-0).
Also, the zero-length file problem is fixed now, in SVN r3763.
Re: Crash with PNG8 output
Posted: 2011-03-05T18:42:08-07:00
by Drarakel
With IM v6.6.8-0 Q16 (Win32), the first command now works (and the colors are reduced). Thanks!
Drarakel wrote:convert rose: PNG8:test.png
But there's still a problem with 'color-type':
Drarakel wrote:convert -verbose rose: -define png:color-type=3 test.png
ROSE PPM 70x46 70x46+0+0 8-bit DirectClass 9.67KB 0.000u 0:00.000
rose:=>ROSE ROSE 70x46 70x46+0+0 8-bit DirectClass 9.67KB 0.000u 0:00.016
rose:=>test.png ROSE 70x46 70x46+0+0 8-bit DirectClass 9.67KB 0.000u 0:00.000
The verbose messages look ok. But there's no file! And also no error message. Only in the debug messages, I see a "Cannot write PNG8 or color-type 3; colormap is NULL" line.
Re: Crash with PNG8 output
Posted: 2011-03-05T19:46:00-07:00
by el_supremo
Glenn: I've been trying to build the windows version of 6.6.8-0 from source this evening and the png coder fails to compile with 29 messages identical to these except for line numbers:
Code: Select all
58>..\..\coders\png.c(7574): error C2296: '>>' : illegal, left operand has type 'Quantum'
58>..\..\coders\png.c(7576): error C2296: '>>' : illegal, left operand has type 'Quantum'
58>..\..\coders\png.c(7577): error C2296: '>>' : illegal, left operand has type 'Quantum'
58>..\..\coders\png.c(7578): error C2296: '>>' : illegal, left operand has type 'Quantum'
58>..\..\coders\png.c(7579): error C2296: '>>' : illegal, left operand has type 'Quantum'
I'm using the MSVC Visual Studio 2010 C++ compiler.
How can I fix these to get them to compile?
BTW - it fails with both x32 and x64 targets.
Pete
Re: Crash with PNG8 output
Posted: 2011-03-06T07:45:13-07:00
by magick
We'll release ImageMagick 6.6.8-1 by tomorrow with a patch to fix the HDRI-png compile problem. Thanks.
Re: Crash with PNG8 output
Posted: 2011-03-06T13:01:44-07:00
by el_supremo
Tried 6.6.8-1 with Q16, FFTW, HDRI and OPENMP and it compiles with no complaint. Thanks.
Pete
Re: Crash with PNG8 output
Posted: 2011-03-06T16:30:03-07:00
by glennrp
Drarakel wrote:The verbose messages look ok. But there's no file! And also no error message. Only in the debug messages, I see a "Cannot write PNG8 or color-type 3; colormap is NULL" line.
The exception was being thrown into the encoder's temporary image structure (image) instead of into (IMimage). Fixed in SVN r3808 for ImageMagick-6.6.8-2.
Re: Crash with PNG8 output
Posted: 2011-03-10T10:24:28-07:00
by Drarakel
glennrp wrote:Drarakel wrote:The verbose messages look ok. But there's no file! And also no error message. Only in the debug messages, I see a "Cannot write PNG8 or color-type 3; colormap is NULL" line.
The exception was being thrown into the encoder's temporary image structure (image) instead of into (IMimage). Fixed in SVN r3808 for ImageMagick-6.6.8-2.
Yes, 'works' now in IM v6.6.8-2 (with a normal error message). Thank you!