From 6809e665273e2a4626d1494bd201f8059688bcd0 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 28 Sep 2020 17:15:09 +0100 Subject: [iiifdownloader] Work around oxford needing the iiif suffix adding to its id --- cmd/iiifdownloader/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/iiifdownloader/main.go b/cmd/iiifdownloader/main.go index 507293b..737cdb5 100644 --- a/cmd/iiifdownloader/main.go +++ b/cmd/iiifdownloader/main.go @@ -153,7 +153,14 @@ func parseIIIFManifest(u string) ([]string, error) { for _, canvas := range v.Sequences[0].Canvases { for _, image := range canvas.Images { - urls = append(urls, image.Resource.Id) + u := image.Resource.Id + // iiif.bodleian.ox.ac.uk serves manifests that use an ID which + // redirects to a info.json unless we manually add the appropriate + // iiif parameters. + if !strings.HasSuffix(u, ".jpg") && !strings.HasSuffix(u, ".jpeg") { + u += "/full/full/0/native.jpg" + } + urls = append(urls, u) } } -- cgit v1.2.1-24-ge1ad