Skip to content

Commit

Permalink
Encoding thumbnail urls
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed Oct 4, 2024
1 parent fa018e3 commit f039ff1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion iiify/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def addThumbnails(manifest, identifier, files):
mimetype = "image/png"

thumbnails.append({
"id": f"{ARCHIVE}/download/{identifier}/{file['name']}",
"id": f"{ARCHIVE}/download/{quote(identifier)}/{quote(file['name'])}",
"type": "Image",
"format": mimetype,
})
Expand Down
8 changes: 8 additions & 0 deletions tests/test_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ def test_multi_file(self):
manifest = resp.json
self.assertEqual(len(manifest['items']),6, f"Expected five canvases, but got {len(manifest['items'])}")

def test_encoded_thumb(self):
resp = self.test_app.get("/iiif/3/steamboat-willie-16mm-film-scan-4k-lossless/manifest.json")
self.assertEqual(resp.status_code, 200)
manifest = resp.json
self.assertEqual(len(manifest['thumbnail']),15, f"Expected 15 thumbnails, but got {len(manifest['items'])}")
self.assertEqual(manifest['thumbnail'][0]['id'],"https://archive.org/download/steamboat-willie-16mm-film-scan-4k-lossless/steamboat-willie-16mm-film-scan-4k-lossless.thumbs/Steamboat%20Willie%20%5B16mm%20Film%20Scan%5D_ProRes%20%283400x2550%29_000001.jpg", f"Expected URL to be encoded")



''' to test:
kaled_jalil (no derivatives)
Expand Down

0 comments on commit f039ff1

Please sign in to comment.