This feature request is for extension: storage-resize-images
Right now, if the DELETE_ORIGINAL_FILE param is set to true, storage-resize-images will delete the original image it is resizing even if the resize operation fails. We should consider not deleting the original image if the resize fails.
If the resize operation fails, at least the original image still exists, so it could potentially be used in place of a resized image.
It's a breaking change - people that use the extension currently may expect and want the original images to be deleted no matter what.
I propose we change the behavior of DELETE_ORIGINAL_FILE: true to not delete the original image if resize fails. When we release this change, we can mark it as a breaking change.
My original idea was in the case that the DELETE_ORIGINAL_FILE param is set to true, an additional layer of configuration is allowed where you can toggle whether or not the file is deleted on failure - if this is possible at all. That way we can keep the default state while enabling this new feature.
One sneaky way to try to make this backwards compatible would be to change DELETE_ORIGINAL_FILE into a SELECT param instead that accepts true (always delete), false (never delete), and on_success (when resizing was successful). This would preserve behavior for existing values but open up the ability to delete on success without introducing an additional param...
@mbleigh that's a great idea! Let's do that.
@ryqndev thanks for the original proposal!
Most helpful comment
One sneaky way to try to make this backwards compatible would be to change
DELETE_ORIGINAL_FILEinto a SELECT param instead that acceptstrue(always delete),false(never delete), andon_success(when resizing was successful). This would preserve behavior for existing values but open up the ability to delete on success without introducing an additional param...