fix image
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user