From e2f3f236de5e29a41ee71a11e7c982aa8aac5610 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 5 Nov 2024 16:57:59 +0100 Subject: [PATCH] chore(image): don't try to process empty images --- app/models/concerns/attachment_image_processor_concern.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/concerns/attachment_image_processor_concern.rb b/app/models/concerns/attachment_image_processor_concern.rb index cd0e3ff65..921d1c5bf 100644 --- a/app/models/concerns/attachment_image_processor_concern.rb +++ b/app/models/concerns/attachment_image_processor_concern.rb @@ -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