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

[Jupiter] Image collection missing thumbnails for tif files. #991

Closed
weiweishi opened this issue Jan 22, 2019 · 4 comments
Closed

[Jupiter] Image collection missing thumbnails for tif files. #991

weiweishi opened this issue Jan 22, 2019 · 4 comments
Assignees

Comments

@weiweishi
Copy link
Contributor

Is your feature request related to a problem? Please describe.
It seems that most image files in this big image collection
https://era.library.ualberta.ca/communities/017b5983-6bca-47d1-9760-0435ed3aedd8/collections/bcf586ac-ab61-49e1-839f-b9f517839e9e don't have thumbnails.
They are tif files (instead of tiff files). This is an important image collection in ERA and it would be critical to have the thumbnails for items in this collection

Describe the solution you'd like
Review the settings in minimagick to ensure tif files can be processed?

@weiweishi weiweishi changed the title Image collection missing thumbnails for tif files. [Jupiter] Image collection missing thumbnails for tif files. Jan 24, 2019
@weiweishi
Copy link
Contributor Author

Wasn't able to identify a tiff file within this collection. Let's start with looking into the extensions that minimagick is handling.

@ConnorSheremeta
Copy link
Contributor

Looks like .tif files are getting an 'ActiveStorage::InvariableError' when the .variant() method is called on the file which is causing .preview() to be called on the file which gives an 'ActiveStorage::UnpreviewableError' and then the view ultimately ends up just rendering a generic file icon (one partial where this happens is here.)

This looks to be an ActiveStorage issue which appears to be fixed in rails 6.x (haven't been able test however and Rails 6 is still in beta). Not sure if it's worth just waiting for a rails 6 upgrade...

It would be possible to use url_for(file) as the first parameter in image_tag just for tifs and then use css to make it the proper size but then you're pulling the full image each time you load a thumbnail instead of just a 100x100 image.

@ConnorSheremeta
Copy link
Contributor

config.active_storage.variable_content_types.push 'image/tiff'
config.active_storage.content_types_allowed_inline.push 'image/tiff'

Can be added to config/application.rb which resolves the issue. It could be removed when we upgrade rails

@weiweishi
Copy link
Contributor Author

Thanks @ConnorSheremeta Work well done. Issue solved in production.

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

2 participants