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
Closed

Always optimize images even if the dimensions match #546

leofeyer opened this issue Jul 3, 2019 · 9 comments
Assignees
Labels
Milestone

Comments

@leofeyer
Copy link
Member

leofeyer 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?

@leofeyer leofeyer added the up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. label Jul 3, 2019
@ausi
Copy link
Member

ausi 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
Copy link
Member Author

leofeyer 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
Copy link
Member

Toflar 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
Copy link
Member Author

leofeyer 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
Copy link
Member

Toflar commented Jul 3, 2019

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

@leofeyer leofeyer added feature and removed up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. labels Jul 3, 2019
@leofeyer leofeyer added this to the 4.8 milestone Jul 3, 2019
@ausi
Copy link
Member

ausi commented Jul 3, 2019

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

@leofeyer
Copy link
Member Author

leofeyer commented Jul 3, 2019

Yes please. 👍

@ausi
Copy link
Member

ausi commented Jul 3, 2019

@leofeyer
Copy link
Member Author

leofeyer commented Jul 4, 2019

Changed in 0ad6d24.

@leofeyer leofeyer closed this as completed Jul 4, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants