-
Notifications
You must be signed in to change notification settings - Fork 256
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
Handle canvases with no images across all views #1231
Conversation
@jbaiter good progress! Is this work in reference to this issue (still unresolved)? It seems that instead of the symbol, one would likely want to display a message to the user via the "label" metadata, since there could be a variety of reasons a canvas has no I'm also curious as to whether one can annotate a canvas with no images, which it seems should be supported according to the Presentation 2.1 spec. |
Did not know about this issue, thanks for pointing it out! My changes were primarily driven by some defective objects here at the BSB that we want to serve via IIIF nevertheless. I did not think too deeply about other use cases, but it would definitely be good to display as much information as possible about the blank canvas. The symbol is only used for the thumbnails and the book- and scroll-views. The reason for this is that we can't completely circumvent OSD (like for the image view) since one of the two pages might still be present. It should be possible to put arbitrary HTML content onto the missing canvas, but tbh, I was too lazy to implement it, since it was not really needed for our use case.
In our case it is to make sure that the reader understands that there is supposed be a page there, but we are unable to serve it. If we just skipped the defective canvas, it would be very confusing.
Yes, this works just fine and is actually what our manifests do, I just added the empty array to the description to make it clearer :-) The check in the code is just |
Ok, great! If I understand your use case correctly, you are able to generate canvases in your manifest for each defective image. I imagine you could also generate a label for it to convey the problem to the user? If not, I would definitely chime in on that issue. Also, I might suggest a question mark (for "unknown" content) rather than the symbol you've chosen, which tends to be more associated with "access denied" or "prohibited" content. |
Agreed, I will use the available labels in addition to the error message.
That's indeed a better choice :-) I will add both things first thing tomorrow! |
Took a bit longer, but I replaced the symbol with a simple question mark (and added borders so it is clearer in double-page view) and added support for displaying the canvas label in addition to the error message. |
Thanks @jbaiter for this PR, this is very useful for at least two demo use cases involving missing pages inside reconstructed manuscripts, so using empty canvases (see for example these manifests: http://iiif.biblissima.fr/bbmn-1713-t1/manifest.json and http://demos.biblissima-condorcet.fr/iiif/metadata/florus-dispersus/manifest.json). It seems that your code only handles canvases with empty "images" array. Moreover the sample manifest you gave in the comment above has a width/height equal to 0, which is not a good practice as far as I know (for instance you may have annotations on the canvas, even if it is blank... scholars may have something to say about the lacuna). |
No, as mentioned before, the code checks for the truthiness of the
Thanks for pointing that out! I will fix that in our backend :-) Also, thanks for the two example manifests, I found a few bugs through them that are now fixed :-) |
ok @jbaiter, this is great! Now it works fine for me with your last two commits, thanks. I will update the placeholder in the fr translations as soon as your PR is merged (but I think I will skip the "Unfortunately" because it is a bit heavy in french) |
Changes Unknown when pulling 210b741 on dbmdz:handle-no-images-on-canvas into ** on ProjectMirador:2.2.0**. |
@jbaiter Just a question. I have a use case where I need to not display the image but do show the annotations on the canvas -- a temporary hack to hide copyrighted images from certain users -- and am wondering if I can free-ride on your enhancement. But your change would disable the display of the annotations too, since you are not instantiating the OpenSeaDragon object, right? |
Unfortunately, yes :/ Though one could probably work around that with some inline SVG-hackery, i.e. put the placeholder text/image into an SVG that gets passed as an image source to OSD. Though I don't know if OSD handles SVGs :-) |
@jbaiter Regarding "truthiness of the images property", an empty array [] is truthy (will evaluate to true in the I think that's why it fails for me when I set images = [] in my manifest? |
Oh boy, thank you, I had forgotten how utterly bizarre JavaScript's concept of truthy values is.... |
We're starting concerted development on Mirador 3, so PRs to 2.x are going to be closed out. If this is still an important feature or fix, please re-open on the release-2.7 branch when it becomes available. |
This PR adds support for canvases with no images to all Mirador views (i.e. Gallery, Image, Scroll, Book), as discussed in #577.
That is, for canvases like these:
Mirador will now make this fact clear in the interface:
Previously Mirador would completely break down with manifests like these.
Unfortunately I'm not that good at graphical design, so the placeholder images will probably need some more work :-)