chore(image): don't try to process empty images

This commit is contained in:
Colin Darie 2024-11-05 16:57:59 +01:00
parent 2656ec18af
commit e2f3f236de
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -21,6 +21,7 @@ module AttachmentImageProcessorConcern
return if blob.attachments.size != 1
return if blob.attachments.last.record_type == "Export"
return if !blob.content_type.in?(PROCESSABLE_TYPES)
return if blob.byte_size.zero? # some empty files may be considered as image depending on filename
ImageProcessorJob.perform_later(blob)
end