Setting -quality option for fileDerivatives

In order to leverage page loading time we would like to control the quality parameter for derivative images created by ImageMagick.

As of now we’ve temporary modified the derivative strategy for ExternalImageMagick and added the quality param there.
Are the only accepted file derivatives strategy options those listed in the config file? Or could we add a “fileDerivatives.strategyOptions.quality” setting of our own?

The options aren’t set in stone, they can be different from strategy to strategy and can be freely created. Anywhere a strategy calls $this->getOption(), it will look for the given named option and substitute the default in the second parameter if the option isn’t set in the INI file.

You can of course just do it directly to your copy, but we’d probably be open to accepting a change that adds such an option.

Hey y’all

I’m hoping to set a custom image quality on all derivative images similar to the original poster, however I am looking to increase the quality. As an Omeka novice, I’m unfamiliar with how I would create a new strategy in this case, but this seems to be the answer I’m looking for. Just hoping for a bit more explanation on how to implement this.

Apart from this, I’ve attempted to add the parameter into the _getConvertArgs() function at libraries/Omeka/File/Derivative/Strategy/ExternalImageMagick.php within the $args arrays with no luck. The images are still severely losing quality and making the text of a nicely scanned image nearly unreadable, or at best, unpleasant looking.

Any tips, tricks, or helpful links would be much appreciated.

Do you have an example file you’re working with, whether just the file itself or a link to an Omeka item or file page showing your current results?

Adding the -quality flag isn’t difficult, but there’s often other things that are more significant like the selected resolution or other specific settings for things like PDF handling.