RussCoder / djvujs

DjVu.js is a program library for working with .djvu files online without any connection with the server. DjVu.js Viewer is a widget that allows viewing .djvu files right in the browser and can be easily embedded into any web page.
https://djvu.js.org/
Other
182 stars 36 forks source link

The task contains an incorrect sequence of functions! #29

Closed jsbien closed 4 years ago

jsbien commented 4 years ago

We get this error message e.g. for https://djvu.szukajwslownikach.uw.edu.pl/sw/01/index.djvu?djvuopts&page=1&zoom=width&showposition=0.493,0.115&highlight=782,3470,1261,200 Other similar links work correctly, e.g. https://djvu.szukajwslownikach.uw.edu.pl/linde/index.djvu?djvuopts&page=1&zoom=width&showposition=0.187,0.054&highlight=408,2979,73,88 https://djvu.szukajwslownikach.uw.edu.pl/linde-t/01/index.djvu?djvuopts&page=1&zoom=width&showposition=0.376,0.419&highlight=1423,3761,1141,218 The failing link is opened correctly by djview.

jsbien commented 4 years ago

Looks like you don't handle shared dictionary 'shared_anno.iff'.

RussCoder commented 4 years ago

Yes, it seems that there is a peculiarity in that document, which I haven't taken into account when implemented the support of indirect djvu. I will debug it more thoroughly.

But how did you understand that the problem is in 'shared_anno.iff' ? Did you debug the code? Just interesting to know.

jsbien commented 4 years ago

When a document is opened in djview the View menu has "Information" entry which lists all the "chunks" of the document. All other dictionaries on our site, which are opened correctly, don't contain the 'shared_anno.iff' chunk.

RussCoder commented 4 years ago

It turned out the shared_anno.iff is essentially empty - only 16 bytes of headers. Didn't expected there maybe useless empty dependencies. But formally, it's a valid djvu. Just ignored the empty chunk and it worked. Available for Firefox, submitted to Chrome. Version 0.3.6.1