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

Rendering problems in Firefox #469

Closed
ahankinson opened this issue Nov 1, 2018 · 3 comments
Closed

Rendering problems in Firefox #469

ahankinson opened this issue Nov 1, 2018 · 3 comments

Comments

@ahankinson
Copy link
Member

There is a problem with rendering pages with firefox. Symptoms are flickering canvas and an error in the console:

"IndexSizeError: Index or size is negative or greater than the allowed amount"

This can be seen with this manifest:

https://digilib.mpiwg-berlin.mpg.de/digitallibrary/Manifester/IIIF/permanent!library!KNA1AZYB!pageimg

@robcast
Copy link
Contributor

robcast commented Nov 2, 2018

I can also reproduce the exception with the default test manifest in a fresh build of diva.js master after some scrolling in Firefox (64b dev).

robcast added a commit to robcast/diva.js that referenced this issue Nov 2, 2018
see: DDMAL#469

Skips canvas draw if tile width or height is zero. This only cures the
symptom ;-(
@robcast
Copy link
Contributor

robcast commented Nov 2, 2018

To me it looks like destHeight is set to zero when scaledTile.dimensions.height or the other one are equal to destYOffset in:

const destHeight = Math.min(scaledTile.dimensions.height, img.height * scaledTile.scaleRatio) - destYOffset;

I don't know what this line is supposed to do and why it malfunctions but I get rid of the exceptions when I skip the drawImage() when the computed widths or heights are zero.

This is not a real fix of course ;-)

@ahankinson
Copy link
Member Author

that actually could be a solution; if the tile is less than 1, we probably should not attempt to draw it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants