mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 20:05:55 +08:00
Merge branch 'release/1.30.0' into develop
This commit is contained in:
commit
2aaf94051c
4 changed files with 7 additions and 6 deletions
BIN
app/assets/images/scinote_logo.png
Normal file
BIN
app/assets/images/scinote_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
|
@ -30,9 +30,9 @@ module Reports::Docx::PrivateMethods
|
||||||
end
|
end
|
||||||
|
|
||||||
def insert_logo
|
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
|
data logo_data
|
||||||
height 20
|
height 20
|
||||||
width 100
|
width 100
|
||||||
|
|
|
@ -128,7 +128,8 @@ module Reports
|
||||||
image = TinyMceAsset.find_by(id: Base62.decode(elem.attributes['data-mce-token'].value))
|
image = TinyMceAsset.find_by(id: Base62.decode(elem.attributes['data-mce-token'].value))
|
||||||
return unless image
|
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)
|
dimension = FastImage.size(image_path)
|
||||||
|
|
||||||
return unless dimension
|
return unless dimension
|
||||||
|
|
|
@ -11,12 +11,12 @@ module Reports
|
||||||
def self.image_prepare(asset)
|
def self.image_prepare(asset)
|
||||||
if asset.class == Asset
|
if asset.class == Asset
|
||||||
if asset.inline?
|
if asset.inline?
|
||||||
asset.large_preview
|
asset.preview_attachment.representation(resize_to_limit: Constants::MEDIUM_PIC_FORMAT, format: :png)
|
||||||
else
|
else
|
||||||
asset.medium_preview
|
asset.preview_attachment.representation(resize_to_limit: Constants::LARGE_PIC_FORMAT, format: :png)
|
||||||
end
|
end
|
||||||
elsif asset.class == TinyMceAsset
|
elsif asset.class == TinyMceAsset
|
||||||
asset.image
|
asset.image.representation(format: :png)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue