PNG Compression Level With -define...

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

PNG Compression Level With -define...

Post by stupid »

Using: ImageMagick-6.7.5-0-Q16-windows-static.exe

Hi, all.

I'm using this command:
-define png:compression-level=0

and getting this error message:
convert.exe: ignoring invalid defined png:compression-level =0 @ warning/png.c/WritePNGImage/11175.

In the error message, the space in front of the equals sign is not in my command. Am I missing something obvious or is it your problem?

Thanks.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: PNG Compression Level With -define...

Post by Bonzo »

First thing I would try is putting the code in between ""

Code: Select all

-define "png:compression-level=0"
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: PNG Compression Level With -define...

Post by glennrp »

It's a bug in the PNG encoder ("if" should be "else if" at line 11146 in coders/png.c)
I will fix this evening when I get home.
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: PNG Compression Level With -define...

Post by stupid »

Thanks for the fix, and the update glennrp.

s.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: PNG Compression Level With -define...

Post by glennrp »

stupid wrote:Thanks for the fix, and the update glennrp.

s.
Also note that the bug is harmless. You get the spurious warning message but
the coder does not in fact ignore the directive. The error has been fixed
in soon-to-be-released 6.7.5-1.
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: PNG Compression Level With -define...

Post by stupid »

Yup. I saw that the output file size was as expected; but it's difficult - for me - to check the integrity of the internal structure. Thanks again.

s.
Post Reply