internetarchive / bookreader

The Internet Archive BookReader
https://openlibrary.org/dev/docs/bookreader
GNU Affero General Public License v3.0
1k stars 419 forks source link

Investigate IIIF demo error #275

Closed iisa closed 9 months ago

iisa commented 4 years ago

Problem:

The IIIF demo page in ./BookReaderDemo/demo-iiif.html throws an error as follows:

Uncaught TypeError: Cannot read property 'width' of undefined (IIIFBookReader.js:69)
    at L.brInstance.getPageHeight (IIIFBookReader.js:69)
    at e.<computed> (classes.js:31)
    at e.value (BookModel.js:72)
    at e.value (Mode2Up.js:376)
    at e.value (Mode2Up.js:473)
    at L.s (classes.js:19)
    at L.switchMode (BookReader.js:1441)
    at L.init (BookReader.js:365)
    at Object.success (IIIFBookReader.js:120)
    at fire (jquery-1.10.1.js:3074)

Task:

kristopolous commented 4 years ago

It's caused by the page number not being set (currentIndexL) prior to making the call. then it gets an NaN for indexing an array and we see this issue. It looks like either there needs to be a default value, this initial case has to be accounted for, or the order of the operations need to change ... I'll see if I can find a really low impact fix for this.

giacomo-cgn commented 4 years ago

(these 3 commits are sequential)

spacejamjim commented 4 years ago

Most likely already known but the IIIFBookReader.js as it stands uses IIIF 1.0 full/full/0/native.jpg versus the default.jpg which would be a quick fix. Also, thanks a TON.

nynaalekhya commented 3 years ago

@iisa Can I work on this issue?