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

Always optimize images even if the dimensions match #546

Closed
leofeyer opened this issue Jul 3, 2019 · 9 comments

Comments

Projects
None yet
3 participants
@leofeyer
Copy link
Member

commented Jul 3, 2019

In #529 we have added an option to optimize images even if they do not have to be resized. The option is disabled by default, which means that the original, potentially unoptimized image is used if the dimensions match. While I understand that this maintains the previous behavior, I still think we should enable the option by default. It never makes sense to use unoptimized images, does it?

@ausi

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

It never makes sense to use unoptimized images, does it?

It does, if your images are already optimized. In this case (re-)processing the image would decrease the quality and might even increase the file size.

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2019

Good point. However, experience shows that the majority of images will not be optimized, therefore I still think we should enable the option by default.

@Toflar

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

There are arguments for both sides which is why it is configurable. I'd leave it as is because it makes sure there are no sudden surprises.

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2019

@ausi has suggested to enable it for all existing image sizes during the version 4.8 update (BC) but to disable it by default for new image sizes. That sounds like a good compromise to me.

@Toflar

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

We can do that too, I'm okay with that.

@leofeyer leofeyer added feature and removed up for discussion labels Jul 3, 2019

@leofeyer leofeyer added this to the 4.8 milestone Jul 3, 2019

@ausi

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

Then I should probably also invert the default value in contao/image src/ResizeOptions.php:37

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2019

Yes please. 👍

@leofeyer leofeyer self-assigned this Jul 4, 2019

leofeyer added a commit that referenced this issue Jul 4, 2019

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Jul 4, 2019

Changed in 0ad6d24.

@leofeyer leofeyer closed this Jul 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.