+quality always throws InvalidArgument error

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
fthiel
Posts: 3
Joined: 2018-11-27T06:50:41-07:00
Authentication code: 1152

+quality always throws InvalidArgument error

Post by fthiel »

Hello,

I tried to use the +quality option but regardless if I use it without a value or with a value I get the following message:

magick: InvalidArgument '+quality' '(null)' at CLI arg 2 @ error/operation.c/CLISettingOptionInfo/1243.

Is this a bug or is this correct an I'm doing something wrong?
What exactly is the effeect of +quality? My first assumption was it resets the quality setting.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: +quality always throws InvalidArgument error

Post by snibgo »

Why do you think "+quality" is a valid IM option? Is it documented somewhere?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: +quality always throws InvalidArgument error

Post by fmw42 »

Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: +quality always throws InvalidArgument error

Post by GeeMack »

snibgo wrote: 2018-11-27T07:19:01-07:00Why do you think "+quality" is a valid IM option? Is it documented somewhere?
I don't know anything about a "+quality" option, but it does show in the list from this command...

Code: Select all

convert -list command
It shows up in the list from several versions as recently as 7.0.8-14. I've tried various commands, and I get the same error as the OP with v6.9.10-11 and v7.0.8-14, but I get no error with v6.8.9-9 in a bash shell on Windows.

I could see it being useful in a command like this...

Code: Select all

convert input.png -quality 100 -resize 50% -write output.jpg +quality -resize 50% output.png
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: +quality always throws InvalidArgument error

Post by snibgo »

It's documented, so it should work, so it's a bug.
snibgo's IM pages: im.snibgo.com
fthiel
Posts: 3
Joined: 2018-11-27T06:50:41-07:00
Authentication code: 1152

Re: +quality always throws InvalidArgument error

Post by fthiel »

I'm using ImageMagick 7.0.8-14-Q16 and the +quality command is contained in the command list:
GeeMack wrote: 2018-11-27T10:08:26-07:00 I don't know anything about a "+quality" option, but it does show in the list from this command...

Code: Select all

convert -list command
and I found it here https://github.com/ImageMagick/ImageMag ... ion.c#L923. This way I already found out that there is for example a +format and +verbose option which are also not documented on this page https://www.imagemagick.org/script/comm ... ptions.php like +quality.

I noticed something, the following commands are working as expected:

Code: Select all

convert rose: -quality 100 -write output.jpg +quality output2.jpg
but if I use "magick" instead of "convert" I can easily reproduce the InvalidArgument error:

Code: Select all

magick rose: -quality 100 -write output.jpg +quality output2.jpg
magick: InvalidArgument '+quality' '(null)' at CLI arg 6 @ error/operation.c/CLISettingOptionInfo/1243.
I also tried out magick-script and got the same error:

Code: Select all

C:\temp\test>magick -script -
rose:
-quality 100
-write output.jpg
+quality
magick: InvalidArgument '+quality' '(null)' in "stdin" at line 4,column 1 @ error/operation.c/CLISettingOptionInfo/1243.
So this looks like a bug to me.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: +quality always throws InvalidArgument error

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.
fthiel
Posts: 3
Joined: 2018-11-27T06:50:41-07:00
Authentication code: 1152

Re: +quality always throws InvalidArgument error

Post by fthiel »

Thank you for looking into this.
Post Reply