Merge branch 'release/1.30.0' into develop

This commit is contained in:
Martin Artnik 2024-03-26 14:23:21 +01:00
commit 2aaf94051c
4 changed files with 7 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -30,9 +30,9 @@ module Reports::Docx::PrivateMethods
end
def insert_logo
logo_data = File.read(Rails.root.join('app/assets/images/scinote_logo.svg'))
logo_data = File.read(Rails.root.join('app/assets/images/scinote_logo.png'))
@docx.img 'logo.svg' do
@docx.img 'logo.png' do
data logo_data
height 20
width 100

View file

@ -128,7 +128,8 @@ module Reports
image = TinyMceAsset.find_by(id: Base62.decode(elem.attributes['data-mce-token'].value))
return unless image
image_path = Reports::Utils.image_prepare(image).url
image_path = Reports::Utils.image_prepare(image).processed.url
dimension = FastImage.size(image_path)
return unless dimension

View file

@ -11,12 +11,12 @@ module Reports
def self.image_prepare(asset)
if asset.class == Asset
if asset.inline?
asset.large_preview
asset.preview_attachment.representation(resize_to_limit: Constants::MEDIUM_PIC_FORMAT, format: :png)
else
asset.medium_preview
asset.preview_attachment.representation(resize_to_limit: Constants::LARGE_PIC_FORMAT, format: :png)
end
elsif asset.class == TinyMceAsset
asset.image
asset.image.representation(format: :png)
end
end