fileupload state, after resizing an image using imageeditor, has multiple TemporaryUploadedFile's
Hi! Is it by design or am I missing something? For instance, when I upload a file using FileUpload field and after that resize the image using imageEditor, I get an array of original and modified image in the state. Why previous image is not deleted?
5 Replies
Because they both exist in tmp storage and the image(s) aren’t actually processed until persisting the record. Also allows you to save both images so that the edited version isn’t destructive.
I noticed this too last week. Might be nice to add a flag to the upload to control this actively.
->keepOriginal()
or something similar, if it doesn't exist yet.Not entirely a bad idea.
I think there’s an open issue around this too.
In my case I have a problem about this, because I do validation on image aspect ratio and it seems that FileUpload component always gets original image instead of resized images.
I opened the issues page on GitHub so I remember. I might put some work into this next week. 🤔