mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 03:46:39 +08:00
Merge pull request #7793 from artoscinote/ma_SCI_10970
Don't fail report if a TinyMCE image variant fails to generate [SCI-10970]
This commit is contained in:
commit
0b059899b5
1 changed files with 14 additions and 9 deletions
|
@ -29,6 +29,7 @@ module TinyMceImages
|
|||
)[0]
|
||||
next unless tm_asset_to_update
|
||||
|
||||
begin
|
||||
variant = tm_asset.image.variant(resize_to_limit: Constants::LARGE_PIC_FORMAT)
|
||||
resized_asset = ActiveStorage::Variant.new(variant.blob, variant.variation).processed
|
||||
|
||||
|
@ -42,6 +43,10 @@ module TinyMceImages
|
|||
end
|
||||
|
||||
tm_asset_to_update.attributes['src'].value = convert_to_base64(resized_asset)
|
||||
rescue StandardError => e
|
||||
Rails.logger.error(e)
|
||||
end
|
||||
|
||||
description = html_description.css('body').inner_html.to_s
|
||||
end
|
||||
description
|
||||
|
|
Loading…
Add table
Reference in a new issue