mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 06:52:33 -05:00
fix large images in audit log
This commit is contained in:
1 parent
19b9ba52d4
commit
bcbbf0dd42
1 file changed
+6
@@ -28,6 +28,7 @@ module Submissions
|
||||
}.freeze
|
||||
|
||||
RTL_REGEXP = TextUtils::RTL_REGEXP
|
||||
MAX_IMAGE_HEIGHT = 100
|
||||
|
||||
module_function
|
||||
|
||||
@@ -207,6 +208,11 @@ module Submissions
|
||||
width = field['type'] == 'initials' ? 100 : 200
|
||||
height = resized_image.height * (width.to_f / resized_image.width)
|
||||
|
||||
if height > MAX_IMAGE_HEIGHT
|
||||
width = (MAX_IMAGE_HEIGHT / height) * width
|
||||
height = MAX_IMAGE_HEIGHT
|
||||
end
|
||||
|
||||
composer.image(io, width:, height:, margin: [5, 0, 10, 0])
|
||||
composer.formatted_text_box([{ text: '' }])
|
||||
elsif field['type'].in?(%w[file payment])
|
||||
|
||||
Reference in new issue
Block a user