fix image

This commit is contained in:
Pete Matsyburka
2024-11-01 18:39:03 +02:00
parent 05647135bc
commit ff14caa9f7
2 changed files with 19 additions and 3 deletions
+10 -1
View File
@@ -291,7 +291,16 @@ module Submissions
),
if field['type'].in?(%w[image signature initials stamp])
attachment = submitter.attachments.find { |a| a.uuid == value }
image = Vips::Image.new_from_buffer(attachment.download, '').autorot
image =
begin
Vips::Image.new_from_buffer(attachment.download, '').autorot
rescue Vips::Error
next unless attachment.content_type.starts_with?('image/')
next if attachment.byte_size.zero?
raise
end
scale = [600.0 / image.width, 600.0 / image.height].min