OleksandrWebLab / oc-image-compress-plugin

Simple compression and resize for images
MIT License
6 stars 2 forks source link

Compress images after upload to media library #7

Open chocolata opened 6 years ago

chocolata commented 6 years ago

Hi Alexander,

Question; do you know of a way to compress images when they are uploaded via the media library?

I've noticed that admins don't take into account the filesizes of the uploaded images, causing the server space to fill up rapidly. If I'm not mistaken, there's supposed to be an event handler that is triggered after every upload.

Do you think we could extend the image compress plugin to take into account the media library?

Thanks for your answer.

OleksandrWebLab commented 6 years ago

Hi @maartenmachiels , I think you need to take a look at this file and find the event upload photo:

https://docs.google.com/spreadsheets/d/17vv4zn_ezp9iFBgYhYuYsmUG4MXW9uuIw7aOIrVcHiM/edit?usp=sharing

OleksandrWebLab commented 6 years ago

I don't have a ready-made solution

chocolata commented 6 years ago

Hi, thank you for your answer. That's okay, I'll be looking into it as soon as possible and will share my findings.

Wachem commented 5 years ago

Maybe this can be helpful:

https://stackoverflow.com/questions/52372399/octobercms-rename-file-after-upload-in-media-file-upload-event

chocolata commented 5 years ago

@Wachem thank you so much! This is very useful!