-
Notifications
You must be signed in to change notification settings - Fork 124
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
Universal viewer (UV) fails rendering png with transparent alpha channel #3760
Conversation
This issue has been automatically marked as stale because it has not had activity for 30 days. It will be closed if no further activity occurs within 14 days. Thank you for your contributions. |
I wonder if it will become a problem having this property called "channels" when audio files have "channels" as well. |
@cjcolvar good point, I'll rename it alphachannels ... I want to get this finished this week if at all possible |
It would be good for someone else to review this because I don't work with images and don't feel confident enough. |
@cjcolvar thanks! I need to get the tests passing, and do a bit of manual QA of my own, then I'll ping a couple of reviewers |
e7cf770
to
b113c78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
… also bumps the circle ci cache_key version to rebuild the test app
@no-reply Hi Tom, any chance of a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good. Thanks @geekscruff and @dlpierce !
@@ -33,7 +33,7 @@ def mount_route | |||
|
|||
def override_image_url_builder_in_hyrax_config | |||
insert_into_file 'config/initializers/hyrax.rb', before: /^ # config.iiif_image_url_builder/ do | |||
" config.iiif_image_url_builder = lambda do |file_id, base_url, size|\n" \ | |||
" config.iiif_image_url_builder = lambda do |file_id, base_url, size, format|\n" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change in the lambda signature require updating documentation or at least need to be called out in the 3.0 migration docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe it will.
Fixes #3422; required a new version of Riiif: #125 released as 2.1.
This PR, combined with a change in Riiif will fix an issue whereby images with an alpha channel are incorrectly rendered by Universal Viewer backed by Riiif.
The incorrect rendering occurs because Riiif is asked for a 'jpg', and jpegs do not support alpha channels.
One complication is that Universal Viewer requests 'jpg' even if png is specified in the manifest. The changes proposed in Riiif help to get around that by returning a png if an alpha channel present, irrespective of the request format.
Changes in Hyrax are:
Extend the characterize job to run Imagemagick identify and extract channel information (via the Riiif::ImageInfoExtractor) ... we need channel information to pass to Riiif, and we cannot get this from FITS AFAIK. Channel information could also be useful for preservation purposes, so it is useful to collect it. This channel information is added to the characterization_proxy and indexed into solr.
Change the Riiif info_service to return format AND alpha_channels; Riiif will then check for an alpha channel and preserve this, returning a png instead of a jpg.
@samvera/hyrax-code-reviewers