SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.39k stars 319 forks source link

ContentFile without a name breaks easy_thumbnails #599

Open SachaMPS opened 2 years ago

SachaMPS commented 2 years ago

Hi there,

we had the issue that easy_thumbnail raised a 500 error (expected str, bytes or os.PathLike object, not NoneType) because our custom adapter to a cloud storage just returned a ContentFile without a name. We corrected this for ourselves by setting the name to ContentFile. Nevertheless it might be of interest to check if a name is set in eady_thumbnails at the following line of code:

https://github.com/SmileyChris/easy-thumbnails/blob/92060b9fd7b617cab1ac88d149dc5021d43b35c3/easy_thumbnails/files.py#L120

Regards