Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF thumbnails should be PNG for transparency #1260

Closed
kayakr opened this issue Sep 1, 2019 · 2 comments
Closed

PDF thumbnails should be PNG for transparency #1260

kayakr opened this issue Sep 1, 2019 · 2 comments
Assignees
Milestone

Comments

@kayakr
Copy link
Contributor

kayakr commented Sep 1, 2019

In my experience, JPEG thumbnails from PDFs often end up with black backgrounds.
Compare
2-Thumbnail Image
to
ead3_output_thumbnail-0

The latter .png was generated on the command line in the VM using
sudo convert -thumbnail x300 -background white -alpha remove /var/www/html/drupal/EAD3_Implementation_Survey_Results_and_Discussion_20190320.pdf ead3_output_thumbnail.png

I assume the way to do this is to clone action 'Image - Generate a thumbnail from an original file', change mimetype to image/png and alter the contexts so that the original 'Image - Generate a thumbnail from an original file' action only applies to model=Image, while the new action applies when model=Document?

@dannylamb
Copy link
Contributor

dannylamb commented Sep 3, 2019 via email

@kayakr
Copy link
Contributor Author

kayakr commented Sep 5, 2019

web/modules/contrib/islandora_defaults/config/install/system.action.digital_document_generate_a_thumbnail_from_an_original_file.yml

langcode: en
status: true
dependencies:
  module:
    - islandora_image
id: digital_document_generate_a_thumbnail_from_an_original_file
label: 'Digital Document - Generate a thumbnail from an original file'
type: node
plugin: generate_image_derivative
configuration:
  queue: islandora-connector-houdini
  event: 'Generate Derivative'
  source_term_uri: 'http://pcdm.org/use#OriginalFile'
  derivative_term_uri: 'http://pcdm.org/use#ThumbnailImage'
  mimetype: image/png
  args: '-thumbnail 100x100'
  destination_media_type: image
  scheme: public
  path: '[date:custom:Y]-[date:custom:m]/[node:nid]-[term:name].png'

This is working for me, manually via admin/content. Next we need to tweak contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants