Open chocolata opened 6 years ago
@toughdeveloper This is my question too. Please advise.
@maartenmachiels Have you been able to get it working?
Hi, unfortunately no. I managed to get it working via another plugin: https://github.com/PopcornPHP/oc-image-compress-plugin
This plugin is being migrated to core (see #55), so we are trying to figure out what issues are still relevant to invite to reopen them in core.
Issues that will remain inactive in next 30 days will be closed.
Hi,
Thanks for your fantastic plugin. I'm so glad it's out here, because it works great.
In my project I have a standard form in which people can upload 5 images. These images are stored as file attachment in
System\Models\File
. Right now I'm uploading the images in their original uncompressed form and resize them when they appear on the frontend, using the twig filter{{ '/path/to/image.jpg' | resize(250, 100) }}
. This works great, but I'd like to compress the original images as well.A nice rule I'm having in my head is forcing images not to exceed 1000 by 1000 pixels, and also running them by TinyPNG. This way, I'd save a lot of disk space, because I'm seeing images of 10MB+ in this project.
I've noticed we can use your plugin in PHP too. Is it possible to save the compressed image and to replace the original? Something like:
Would something like this be possible? I was experimenting with another plugin, but kept running into problems.
A second part of the question is: would we be able to do something like the linked plugin, where we compress images as soon as they appear in the media library?
What are your thoughts? Thanks in advance.