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

make encodeURI optional #488

Open
bptarpley opened this issue Sep 23, 2019 · 0 comments
Open

make encodeURI optional #488

bptarpley opened this issue Sep 23, 2019 · 0 comments

Comments

@bptarpley
Copy link

We're currently trying to use DIVA.js to view some IIIF manifests. These manifests point to images being served by the Cantaloupe IIIF server, and by default, the path separator for Cantaloupe is "%2F", such that if you have an image at '/imageroot/collection/image.jpg', the "identifier" for that image would be:

iiif.example.org/iiif/2/collection%2Fimage.jpg

Given the fact that an already percent-encoded string is being used in the manifest files for our images, every time DIVA.js tries to construct the image url for a tile, it calls encodeURI on the image URL and thus attempts to use the wrong URL:

https://github.com/DDMAL/diva.js/blob/master/source/js/iiif-source-adapter.js#L19

Given the example I provided above, the image tile URL looks like this after the above encodeURI call:

iiif.example.org/iiif/2/collection%252Fimage.jpg

This is because it took the percent sign already in the URI and replaced it with "%25" (the percent code for a percent sign). That URL, however, is invalid.

It would be nice if there was a flag we could pass into the options for the diva object to prevent it from encoding image URI's...

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

No branches or pull requests

2 participants