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

Question about image compression #51

Open
PubliAlex opened this issue Feb 5, 2020 · 4 comments
Open

Question about image compression #51

PubliAlex opened this issue Feb 5, 2020 · 4 comments

Comments

@PubliAlex
Copy link
Contributor

Hello,

I noticed a small quality decrease when images are resized using this module. I did not see any image quality configuration on the module setting page.

I wonder how to change compression quality, do you have any advices about it ?

Thank you for this wonderful module !

@tobias-kuendig
Copy link
Member

We are using October's October\Rain\Database\Attach\Resizer class under the hood, so every image is resized using the default quality options (90%).

You can try to pass in other quality values here and see if this changes something for you:
https://github.com/OFFLINE-GmbH/oc-responsive-images-plugin/blob/develop/classes/ResponsiveImage.php#L202

    $this->resizer->resize($size, null, ['quality' => 100])->save($saveTo);

Make sure to clear your storage/temp/public directory first, as a thumbnail is only created once if it not exists already.

@PubliAlex
Copy link
Contributor Author

Tested and yes, it slightly increase the image quality. Could it be configurable in plugin settings ?

Best regards,

@tobias-kuendig
Copy link
Member

Sure, PR welcome!

@PubliAlex
Copy link
Contributor Author

PubliAlex commented Feb 6, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants