-
Notifications
You must be signed in to change notification settings - Fork 242
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
EZP-27993: Support quality override by image alias #1324
EZP-27993: Support quality override by image alias #1324
Conversation
36bab6b
to
3357574
Compare
# Override quality by MIME type for this alias only | ||
# This follows the pattern from the global [MIMETypeSettings] settings | ||
# Quality[] | ||
# Quality[]=image/jpeg;80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In PR description you mention Quality[image/jpeg]=80
as format. This is the correct one as far as I can see?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I've fixed the PR description now! Good catch. I got distracted by the format of the internal map.
foreach ( $qualityOverride as $qualityOverrideValue ) | ||
{ | ||
$elements = explode( ';', $qualityOverrideValue ); | ||
$mimeType = $elements[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe do a basic check if $elements[0]
and $elements[1]
exist before using them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was copying readMIMETypeQualitySettingFromINI() on line 559, so it's consistent to expect the user to follow the right format. Could harden this in a follow-up PR though.
Useful feature 👍 I'm wondering about why use the override values which are constantly reset and filled for every image conversion process? I guess there's no other way if we want to keep |
Right, this was what I came up with without having to send the alias information to each individual conversion handler. I can certainly change it if someone thinks of a way to do this per alias while maintaining the split in concerns between eZImageManager and the conversion handlers. |
Ping @alexgorski |
Very useful feature requested by amnh-digital. |
3357574
to
bfbfb42
Compare
Looks good to me |
Besides the comment from @emodric about testing the values of the quality array, this looks good. This is a must have feature. 👍 |
Great addition for sites that have a lot of aliases where quality needs to be controlled better due to alias size differences e.g. huge banners with high-quality needs vs. thumbnails that can be lower quality. We've got at least a handful of clients where this update would mean a big improvement. +1 from me |
@crevillo you are also good with this? |
yes! I am, sorry, i didn't see this notification. @peterkeung just pinged me about. |
Thanks @crevillo and @emodric for the reviews, and thanks for the work here @peterkeung! |
https://jira.ez.no/browse/EZP-27993
In eZ Publish legacy, we can set a global image quality in image.ini, but cannot override this per alias.
This is the reverse problem as eZ Platform / new stack, where you can set the quality by alias but cannot set a global value (liip/LiipImagineBundle#909).
This way, you can set something like this in image.ini to override the global setting: