Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle invalid min and max output quality better #24

Open
Tenzer opened this issue Jan 1, 2013 · 3 comments
Open

Handle invalid min and max output quality better #24

Tenzer opened this issue Jan 1, 2013 · 3 comments

Comments

@Tenzer
Copy link
Contributor

Tenzer commented Jan 1, 2013

If you specify QUALITY_OUT_MAX less than QUALITY_OUT_MIN+2, imgmin will bug out with an error message such as the following:

Before quality:94 colors:93196 size:247.6kB type:TrueColor format:JPEG
imgmin: wand/magick-wand.c:181: DestroyMagickWand: Assertion `wand !=(MagickWand *) ((void *)0)' failed.
Aborted (core dumped)

It would be better if imgmin either give a decent error message, ie. referring the user to check the out min/max numbers, or if only the min or max value is given, it could automatically push the other value to be a value which makes sense, ie. 10 apart from the value specified.

@rflynn
Copy link
Owner

rflynn commented Jan 11, 2013

Can you specify the cmdline parameters in your example?

@Tenzer
Copy link
Contributor Author

Tenzer commented Jan 12, 2013

I don't know why I didn't do that in the first place.
Here's an example specifying only QUALITY_OUT_MAX:

[jeppet@silhouette test]$ imgmin --quality-out-max 71 pic.jpg pic-out.jpg
Before quality:94 colors:93196 size:247.6kB type:TrueColor format:JPEG
imgmin: wand/magick-wand.c:181: DestroyMagickWand: Assertion `wand != (MagickWand *) ((void *)0)' failed.
Aborted (core dumped)

And specifying only QUALITY_OUT_MIN:

[jeppet@silhouette test]$ imgmin --quality-out-min 94 pic.jpg pic-out.jpg
Before quality:94 colors:93196 size:247.6kB type:TrueColor format:JPEG
imgmin: wand/magick-wand.c:181: DestroyMagickWand: Assertion `wand != (MagickWand *) ((void *)0)' failed.
Aborted (core dumped)

Needless to say, you can also get the error message if you set QUALITY_OUT_MAX to a value less than 2 higher than QUALITY_OUT_MIN.

@fraserhemp
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants