F
Filament15mo ago
vitsw

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
awcodes
awcodes15mo ago
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.
alexanderkroneis
alexanderkroneis15mo ago
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.
awcodes
awcodes15mo ago
Not entirely a bad idea. I think there’s an open issue around this too.
vitsw
vitswOP15mo ago
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.
alexanderkroneis
alexanderkroneis15mo ago
I opened the issues page on GitHub so I remember. I might put some work into this next week. 🤔
Want results from more Discord servers?
Add your server