mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-01 09:24:59 +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
|
||||
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue