xperseguers / t3ext-image_autoresize

TYPO3 Extension image_autoresize. Simplify the way your editors may upload their images.
https://extensions.typo3.org/extension/image_autoresize
GNU General Public License v3.0
16 stars 22 forks source link

Feature: backup copy #113

Closed sturmundbraem closed 1 week ago

sturmundbraem commented 3 months ago

What do you think about moving the uploaded images into a backup folder before resizing and maintaining them there? re #112

xperseguers commented 3 months ago

No because the whole purpose is to gain space on the disk. But such a backup may certainly be implemented by hooking into the upload process similarly to this extension. Possibly I'd fine sending a signal/notification when a file is about to get resized, so that you may implement it and do some backup, but I don't want to implement a backup natively.

sturmundbraem commented 3 months ago

No because the whole purpose is to gain space on the disk

We've had this thought as well.

But for us, the whole purpose is more than just disk space (and why this extension is so important): to prevent server collapses when an image gallery or similar is being rendered and fluid has to resize a gazillion 25mb Photos to 20 srcsets and crop variants each.

xperseguers commented 1 week ago

I double checked, there's already a PSR-14 in place that you can easily listen on, namely \Causal\ImageAutoresize\Event\ImageResizedEvent. It's invoked after a resize (and/or conversion) has been done and before the original file is replaced by the reprocessed version. That event gives you access to the original file with path and the new one.

So you should listen to it in your own (site) extension to do the backup the way you want. Easy!

ursbraem commented 5 days ago

Thank you!