fix generation

pull/721/head
Pete Matsyburka 3 weeks ago
parent 99b3247cf7
commit 2a1a2cbd82

@ -19,6 +19,7 @@ module Submissions
}.freeze }.freeze
TESTING_FOOTER = GenerateResultAttachments::TESTING_FOOTER TESTING_FOOTER = GenerateResultAttachments::TESTING_FOOTER
UNSUPPORTED_IMAGE_TYPES = GenerateResultAttachments::UNSUPPORTED_IMAGE_TYPES
RTL_REGEXP = TextUtils::RTL_REGEXP RTL_REGEXP = TextUtils::RTL_REGEXP
MAX_IMAGE_HEIGHT = 100 MAX_IMAGE_HEIGHT = 100
@ -354,8 +355,9 @@ module Submissions
field_type = field['type'] field_type = field['type']
if field_type == 'image' && if (field_type == 'image' || field_type == 'stamp') &&
submitter.attachments.find { |a| a.uuid == value }.then { |a| !a.image? || a.content_type == 'image/heic' } submitter.attachments.find { |a| a.uuid == value }
.then { |a| !a.image? || a.content_type.in?(UNSUPPORTED_IMAGE_TYPES) }
field_type = 'file' field_type = 'file'
end end

@ -36,6 +36,8 @@ module Submissions
SIGN_REASON = 'Signed with DocuSeal.com' SIGN_REASON = 'Signed with DocuSeal.com'
UNSUPPORTED_IMAGE_TYPES = ['image/heic', 'image/avif'].freeze
RTL_REGEXP = TextUtils::RTL_REGEXP RTL_REGEXP = TextUtils::RTL_REGEXP
TEXT_LEFT_MARGIN = 1 TEXT_LEFT_MARGIN = 1
@ -300,8 +302,9 @@ module Submissions
field_type = field['type'] field_type = field['type']
if field_type == 'image' && if (field_type == 'image' || field_type == 'stamp') &&
submitter.attachments.find { |a| a.uuid == value }.then { |a| !a.image? || a.content_type == 'image/heic' } submitter.attachments.find { |a| a.uuid == value }
.then { |a| !a.image? || a.content_type.in?(UNSUPPORTED_IMAGE_TYPES) }
field_type = 'file' field_type = 'file'
end end

Loading…
Cancel
Save