UniversalViewer / universalviewer

A community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
http://universalviewer.io
Other
489 stars 184 forks source link

viewingHint json property (single string supported instead of list - multivalued) #627

Open MarcAgate opened 5 years ago

MarcAgate commented 5 years ago

UV version:

 universalviewer@<v2.0.2>

I'm submitting a:

"viewingHint":["continuous"]

UV fails to display images However, if I set viewingHint as a string, this way:

"viewingHint":"continuous"

Everything works fine

Expected behavior: Regarding this point, the specs (https://iiif.io/api/presentation/2.1/#technical-properties) explicity says: _

Any resource type may have one or more viewing hints.

_ Therefore I think that UV should support a List of string in this case

Steps to reproduce:

working case : http://universalviewer.io/uv.html?manifest=http://eroux.fr/testmarc.json#?c=0&m=0&s=0&cv=0&xywh=-435%2C18721%2C1583%2C572

failing case: http://universalviewer.io/uv.html?manifest=http://eroux.fr/testmarcfail.json

Other information:

Console msg:

Uncaught TypeError: value.toLowerCase is not a function
    at ViewingHint.StringValue (bundle.min.js:3)
    at new ViewingHint (bundle.min.js:3)
    at Manifest.getViewingHint (bundle.min.js:4)
    at Manifest.isPagingEnabled (bundle.min.js:4)
    at Helper.isPagingEnabled (bundle.min.js:10)
    at Helper.isPagingAvailable (bundle.min.js:10)
    at t.pagingToggleIsVisible (app.js:7)
    at t.updatePagingToggle (app.js:7)
    at t.create (app.js:7)
    at t.e (app.js:1)
3bundle.min.js:3 Uncaught TypeError: value.toLowerCase is not a function
    at ViewingHint.StringValue (bundle.min.js:3)
    at new ViewingHint (bundle.min.js:3)
    at Manifest.getViewingHint (bundle.min.js:4)
    at Manifest.isPagingEnabled (bundle.min.js:4)
    at Helper.isPagingEnabled (bundle.min.js:10)
    at Helper.isPagingAvailable (bundle.min.js:10)
    at t.pagingToggleIsVisible (app.js:7)
    at t.resize (app.js:7)
    at Object.<anonymous> (app.js:1)
    at Object.dispatch (jquery.min.js:5)
LlGC-szw commented 1 year ago

All issues will be triaged for further investigation or closure by the 28 September 2023. If your issue is still relevant and would like for it be investigated further please comment by 14 September 2023.

demiankatz commented 10 months ago

I'm still seeing the failing case manifest causing the UV to fail to load, so I think this is still an active issue... though whether viewingHint should be multi-valued (or how to deal with multiple values if they exist) may require more discussion.

kirschbombe commented 5 months ago

Just commenting to reiterate that this is still an issue. Per the IIIF spec, for the viewingHint/behavior properties "The value must be an array of strings." https://iiif.io/api/presentation/3.0/#behavior.