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

Update v2 code to use Canteloupe and BookReader #16

Open
mprove opened this issue Sep 14, 2023 · 4 comments
Open

Update v2 code to use Canteloupe and BookReader #16

mprove opened this issue Sep 14, 2023 · 4 comments
Labels
bug Something isn't working v2 Issues that affect the old v2 endpoints
Milestone

Comments

@digitaldogsbody digitaldogsbody self-assigned this Sep 14, 2023
@glenrobson
Copy link
Collaborator

Thanks @mprove. We will look into this but its possibly to do with our routing in the new version.

@digitaldogsbody
Copy link
Collaborator

The first of these examples is loading fine for me running the code locally, but not on the deployed main branch code on ux-fnf-misc so I'm at a bit of a loss. We might need the error logs from that service to work out what is going on.

The second one is erroring because the image is too large and PIL is throwing a warning about a potential decompression bomb. It seems like the old v2 code still has a call that ends up downloading and parsing the image in order to get the dimensions: https://github.com/internetarchive/iiif/blob/main/iiify/resolver.py#L208

This eventually leads to PIL.Image.DecompressionBombError: Image size (596826944 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.

I think it's probably out of scope for us to fix this right now as our work is focused on the v3 APIs, but if we have some time later we could look at replacing that web.info() call either with a call to Cantaloupe, or with using the dimensions from the BookReader API instead.

@digitaldogsbody digitaldogsbody added bug Something isn't working v2 Issues that affect the old v2 endpoints labels Nov 2, 2023
@mprove
Copy link
Author

mprove commented Nov 2, 2023

ok. Prio & severity should be lowest. Won't fix is fine with me as well.

@benwbrum benwbrum added this to the Spring 2024 sprint milestone Jan 18, 2024
@glenrobson
Copy link
Collaborator

Call Cantaloupe or book reader to get dimensions rather than downloading the images.

@digitaldogsbody digitaldogsbody changed the title Some v2 manifests not yet generated Update v2 code to use Canteloupe and BookReader Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 Issues that affect the old v2 endpoints
Projects
None yet
Development

No branches or pull requests

5 participants