October: Delete thumbnails when the associated master image is deleted

Created on 22 Jun 2018  路  4Comments  路  Source: octobercms/october

Expected behavior

If you have a image in your model as file attachment and creating thumbs of it, these related thumbs should be automatically as soon as the file attachment / image was deleted. It makes no sense then to keep them. Even worse, these thumbs will flood the temporary dir, which may result in web space overflow on heavy import scripts.

At least there should be a way to delete all thumbs in the API. But I think it would be much more consistent, if those thumbs were deleted _automatically_ (Maybe a switch to keep them on deletion). That would be very convenient and simple.

Actual behavior

Currently the thumbs will be left in the temporary dir, and there seems to be no way thru API to delete them.

Reproduce steps

Attach an image to your model, create thumbs of it, now delete the image.

October build

All

Unconfirmed Bug

Most helpful comment

Yes, i tested it and it works, thas why it was weird for me to see this issue still open @LukeTowers

And dont forget relations needs to have defined 'delete' => true

All 4 comments

Feel free to submit a PR implementing that functionality

@Samuell1 can you test and confirm if this is still an issue? If it exists but it's not working then we'll need to fix it.

Yes, i tested it and it works, thas why it was weird for me to see this issue still open @LukeTowers

And dont forget relations needs to have defined 'delete' => true

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sozonovalexey picture sozonovalexey  路  3Comments

axomat picture axomat  路  3Comments

jvanremoortere picture jvanremoortere  路  3Comments

ChVuagniaux picture ChVuagniaux  路  3Comments

lukaszbanas-extremecoding picture lukaszbanas-extremecoding  路  3Comments