adjust text signature size

This commit is contained in:
Pete Matsyburka
2024-04-10 22:24:19 +03:00
parent 6666f39928
commit 811091ff14
+2 -2
View File
@@ -118,12 +118,12 @@ module Submitters
blob =
if value.match?(%r{\Ahttps?://})
find_or_create_blob_from_url(account, value)
elsif type.in?(%w[signature initials]) && value.length < 50
elsif type.in?(%w[signature initials]) && value.length < 60
find_or_create_blob_from_text(account, value, type)
elsif (data = Base64.decode64(value)) && Marcel::MimeType.for(data).include?('image')
find_or_create_blob_from_base64(account, data, type)
else
raise InvalidDefaultValue, "Invalid value, url, base64 or text < 50 chars is expected: #{value.first(50)}..."
raise InvalidDefaultValue, "Invalid value, url, base64 or text < 60 chars is expected: #{value.first(200)}..."
end
attachment = for_submitter.attachments.find_by(blob_id: blob.id) if for_submitter