2

I have a Django model that has an image and an autogenerated thumbnail:

img = ImageField(upload_to=..., max_length=64)
img_thumbnail = ImageSpecField([ResizeToFit(width=64, height=64)], source='img')

For a number of reasons, the img field may contain a filename that is no longer present in the filesystem. When the file is not there, the view crashes with a FileNotFoundError - No such file or directory: '....png'

Is it possible to configure the img_thumbnail field / django-imagekit to fail silently? Also without writing having to catch the exception in the view.

Martin Massera
  • 1,718
  • 1
  • 21
  • 47

0 Answers0