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

Drupal makes its own thumbnails, and it's confusing. #1108

Open
rosiel opened this issue May 1, 2019 · 4 comments
Open

Drupal makes its own thumbnails, and it's confusing. #1108

rosiel opened this issue May 1, 2019 · 4 comments
Labels
Type: enhancement Identifies work on an enhancement to the Islandora codebase

Comments

@rosiel
Copy link
Member

rosiel commented May 1, 2019

This isn't exactly a problem just a thing that caused some crossed wires, so we should probably know about. We have an Islandora 8 installation where derivatives aren't working, but Thumbnails are getting created, and I think it's Drupal's doing.

We uploaded a JPG as an original file. It's still the only "Media" attached to the Repository Item node (which is typed as an "Image"). So as far as node/34/media is concerned, we have no Service File and no Thumbnail.

But if you go look at the view of all media, /admin/content/media, the recently uploaded image is there represented by a small thumbnail. If you inspect the html, that thumbnail's src is
http://[host]/_flysystem/fedora/styles/thumbnail/fedora/2019-05/IMG_0606.JPG?itok=VCsRkku-

That actually resolves to a file.

This file lives in Fedora, as you can see by crawling Fedora (from the top-level Root Object there's a child at http://[host]:8080/fcrepo/rest/styles/thumbnail/fedora/2019-05 which contains http://[host]:8080/fcrepo/rest/styles/thumbnail/fedora/2019-05/IMG_0606.JPG

Its RDF is sparse:
Screen Shot 2019-05-01 at 5 14 09 PM

I thought that these folders were the result of derivatives running. They are absolutely not. These are from Drupal's Image Styles, configured at admin/config/media/image-styles.

If I alter the View that populates /admin/content/media so the "Thumbnail" field uses the "Medium (220x220)" Image style, then my Fedora root object suddenly contains a bunch new 'medium' folders like http://[host]:8080/fcrepo/rest/styles/medium/fedora/2019-05

So, This is a way that Fedora is being used perhaps without intention. It's not explicitly harmful, but it "muddies up" the distinction that we had made wherein Drupal was the source of front-end stuff, and Fedora was for preservation.

@dannylamb
Copy link
Contributor

That should very much be on Drupal's public filesystem.

This does raise the question of if we should tie more tightly to the Drupal thumbnail system, and the answer is probably, as always, yes. It's been a while since last I looked at that and it's definitely worth re-investigating.

@whikloj
Copy link
Member

whikloj commented May 3, 2019

I think this works for Image media types, but not files (Tiffs). So until they fix that upload form so that we can upload a Tiff as an Image we'll have to stick with this. Maybe they fixed that in 8.7.

Also for things like audio/video/pdf/documents/etc.... I'm not sure how we would handle those.

@dannylamb
Copy link
Contributor

So I looked into this. If we made a custom MediaSource plugin, we can tell it to reference the thumbnails we generate for when we can't use image styles. Might be worth looking into. It goes into detail about what the responsibilities of the plugin are in the documentation: https://api.drupal.org/api/drupal/core%21modules%21media%21src%21MediaSourceInterface.php/interface/MediaSourceInterface/8.6.x

@rosiel
Copy link
Member Author

rosiel commented Sep 22, 2020

👀 Danny that's really really cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement Identifies work on an enhancement to the Islandora codebase
Projects
Development

No branches or pull requests

4 participants