Merge pull request #10963 from demarches-simplifiees/fix-pdf-preview-display
Technique: affiche les vignettes de pdf dans la galerie en l'absence de ImageMagick et pdftoppm sur les machines web
This commit is contained in:
commit
cdaa94d5f6
1 changed files with 2 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
module GalleryHelper
|
||||
def displayable_pdf?(blob)
|
||||
blob.previewable? && blob.content_type.in?(AUTHORIZED_PDF_TYPES)
|
||||
blob.content_type.in?(AUTHORIZED_PDF_TYPES)
|
||||
end
|
||||
|
||||
def displayable_image?(blob)
|
||||
|
@ -16,8 +16,7 @@ module GalleryHelper
|
|||
end
|
||||
|
||||
def preview_url_for(attachment)
|
||||
preview = attachment.preview(resize_to_limit: [400, 400])
|
||||
preview.image.attached? ? preview.processed.url : 'pdf-placeholder.png'
|
||||
attachment.blob.preview_image.url.presence || 'pdf-placeholder.png'
|
||||
rescue StandardError
|
||||
'pdf-placeholder.png'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue