adjust text signature size

pull/250/head
Pete Matsyburka 2 years ago
parent 6666f39928
commit 811091ff14

@ -118,12 +118,12 @@ module Submitters
blob = blob =
if value.match?(%r{\Ahttps?://}) if value.match?(%r{\Ahttps?://})
find_or_create_blob_from_url(account, value) 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) find_or_create_blob_from_text(account, value, type)
elsif (data = Base64.decode64(value)) && Marcel::MimeType.for(data).include?('image') elsif (data = Base64.decode64(value)) && Marcel::MimeType.for(data).include?('image')
find_or_create_blob_from_base64(account, data, type) find_or_create_blob_from_base64(account, data, type)
else 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 end
attachment = for_submitter.attachments.find_by(blob_id: blob.id) if for_submitter attachment = for_submitter.attachments.find_by(blob_id: blob.id) if for_submitter

Loading…
Cancel
Save