SamC Posted November 4, 2017 Share Posted November 4, 2017 I'm going to use the IMagick Image Sizer engine which I just installed. Does the quality here override the quality I set on the front end for image resizing? Let's say it's different: $options = array("quality" => 90, "cropping" => "center"); What is the resulting quality of the image '$thumb'? $thumb = $entry->postThumbnail->size(800, 450, $options); Finding this a bit confusing. Thanks for any advice. ==EDIT== After reading around a few posts, I notice you can set defaults in config.php. So if I: /** * * Global image sizing options * */ $config->imageSizerOptions = array("upscaling" => true, "cropping" => "center", "quality" => 90)); ...then use imagemagick, and set the quality of that to 85, will the cropping center options be applied to images? I read PW will use IMagick if present, then GD as a fallback i.e. do the array above apply only to the fallback? Link to comment Share on other sites More sharing options...
horst Posted November 4, 2017 Share Posted November 4, 2017 It is hirarchically ordered, highest first: $element->size() options are the highest, overrides all other individual ImageEngine-Settings, override all below them, if you have installed two or more engines, only the setting of the finally invoked engine is used site/config.php => $config->imageSizerOptions wire/config.php => $config->imageSizerOptions and last, but more theoretically, if all above would be missing, the hardcoded defaults of the module-file (php-class) would be used The higher override all lower 1 Link to comment Share on other sites More sharing options...
SamC Posted November 4, 2017 Author Share Posted November 4, 2017 20 minutes ago, horst said: It is hirarchically ordered, highest first: $element->size() options are the highest, overrides all other individual ImageEngine-Settings, override all below them, if you have installed two or more engines, only the setting of the finally invoked engine is used site/config.php => $config->imageSizerOptions wire/config.php => $config->imageSizerOptions and last, but more theoretically, if all above would be missing, the hardcoded defaults of the module-file (php-class) would be used The higher override all lower Thanks @horst still not 100% here. For number 2, imagemagick doesn't have a crop setting so that is set in number 3. How does the crop happen in this case? Link to comment Share on other sites More sharing options...
SamC Posted November 4, 2017 Author Share Posted November 4, 2017 So, I've got: // config.php /** * * Global image sizing options * */ $config->custImages = array("upscaling" => true, 'cropping' => "center", "quality" => 90); // _init.php $imgOptions = $config->custImages; // card.php <?php if ($entry->postThumbnail): $thumb = $entry->postThumbnail->size(800, 450, $imgOptions); ?> Imagemagick is installed. So, does this mean the cropping will be applied? Will imagemagick even be used in this case, or GD? This is what's confusing me. = EDIT = Correct me if I'm wrong but everything seems to work now. Images are being cropped, and FAST! Where has imagemagick been all my life?? Link to comment Share on other sites More sharing options...
Robin S Posted November 4, 2017 Share Posted November 4, 2017 (edited) When ImageSizerEngineIMagick is installed, the settings defined in the module config screen for quality and sharpening apply and any settings for these in $config->imageSizerOptions are overridden. See discussion here: I'm not a fan of this and would prefer to have quality and sharpening defined in $config->imageSizerOptions. Edited November 4, 2017 by Robin S Edit: quoted wrong part of original post. You can set quality and sharpening in individual image sizer operation with the $options argument. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now