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

refuses to load dynamic iiif manifest from API #23

Closed
ch-sander opened this issue Jun 6, 2023 · 2 comments
Closed

refuses to load dynamic iiif manifest from API #23

ch-sander opened this issue Jun 6, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ch-sander
Copy link

Example: https://icat.digitaldogsbody.net/iiif/dynamic/tag/EAC
Loads in Mirador: https://dlib.biblhertz.it/m3/?show=https://icat.digitaldogsbody.net/iiif/dynamic/tag/EAC
pdiiif however does not even show the preview.

The dynamic manifest is created via a tool (ICAT) developed by https://github.com/digitaldogsbody

@jbaiter
Copy link
Owner

jbaiter commented Jun 6, 2023

Thank you for reporting! This is an unfortunate bug in estimatePdfSize function: When determining the canvases to use for estimating the PDF size, we check for the length of all manifests for sampling and use all of them if there are fewer than the requested number (currently harcoded at 8).
However, we dont actually sample from all canvases, but filter for canvases that do not deviate more than 25% from the mean pixel area of all canvases in the manifests, to make the estimate more precise.
And in your case, that filtered list of canvases has fewer canvases than we request for sampling (5 vs 8) and so the code will eternally try to sample more here:
https://github.com/jbaiter/pdiiif/blob/main/pdiiif-lib/src/convert.ts#L217-L229

@jbaiter jbaiter added the bug Something isn't working label Jun 6, 2023
@jbaiter jbaiter closed this as completed in 44e9863 Jun 6, 2023
jbaiter added a commit that referenced this issue Jun 7, 2023
**Added**
- New section in README on how to implement custom cover pages by using
  a self-hosted or custom server instance.

**Fixed**
- pdiiif-lib: Fix broken license logo URLs for CC-NC-ND and CC0
- pdiiif-lib: Add missing Public Domain Mark 1.0 license logo
- pdiiif-lib: Fix infinite loop with certain manifests when estimating PDF
  size (#23, thanks @ch-sander for reporting)
- pdiiif-api: Remove pdiiif-web dependency, vendor in bundles and HTML
  to fix shipping via npm

**Changed**
- pdiiif-api: Add support for more handlebars helpers in templates by
  adding `handlebars-helpers`
- Dependency updates for all packages
- Removed mkcert integration
jbaiter added a commit that referenced this issue Jun 7, 2023
**Added**
- New section in README on how to implement custom cover pages by using
  a self-hosted or custom server instance.

**Fixed**
- pdiiif-lib: Fix broken license logo URLs for CC-NC-ND and CC0
- pdiiif-lib: Add missing Public Domain Mark 1.0 license logo
- pdiiif-lib: Fix infinite loop with certain manifests when estimating PDF
  size (#23, thanks @ch-sander for reporting)
- pdiiif-api: Remove pdiiif-web dependency, vendor in bundles and HTML
  to fix shipping via npm

**Changed**
- pdiiif-api: Add support for more handlebars helpers in templates by
  adding `handlebars-helpers`
- Dependency updates for all packages
- Removed mkcert integration
@ch-sander
Copy link
Author

Maybe a related issue:

This PDF is generated but pages are all empty. Loads without problems in Mirador: https://projectmirador.org/embed/?iiif-content=https://icat.digitaldogsbody.net/iiif/1/manifest

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants