NCSU-Libraries / annona

https://ncsu-libraries.github.io/annona/
MIT License
43 stars 8 forks source link

Issue with IIIF Image API urls that end in .jpg #20

Closed glenrobson closed 3 years ago

glenrobson commented 3 years ago

We are using Annona in the IIIF training and have come across an issue when a IIIF Image API URL ends in .jpg. It seems that currently Annona checks the file extension of the URL and if its jpg or png it treats it as a straight image rather than appending the info.json.

Here is an example manifest:

{
    "@context": "http://iiif.io/api/presentation/2/context.json",
    "@id": "http://962b3764-d27d-41ff-b833-045088bd6572-march",
    "@type": "sc:Manifest",
    "label": "Glen's fantastic March 2021 Manifest",
    "service": {
        "profile": "http://iiif.io/api/search/0/search",
        "@id": "http://sas.gdmrdigital.com/search-api/02a12caaedd1cfec04e9cb65ffd6f2f2/search",
        "@context": "http://iiif.io/api/search/0/context.json"
    },
    "metadata": [],
    "description": [
        {
            "@value": "[Click to edit description]",
            "@language": "en"
        }
    ],
    "license": "https://creativecommons.org/licenses/by/3.0/",
    "attribution": "[Click to edit attribution]",
    "sequences": [
        {
            "@id": "http://124c1daa-5983-4040-a1c7-fbb71a034c62",
            "@type": "sc:Sequence",
              "viewingHint": "paged",
            "label": [
                {
                    "@value": "Normal Sequence",
                    "@language": "en"
                }
            ],
            "canvases": [
                {
                    "@id": "http://a292a51f-5975-497f-b9a4-8a962e380762-march",
                    "@type": "sc:Canvas",
                    "label": "Empty canvas",
                    "height": 3024,
                    "width": 4032,
                    "images": [
                        {
                            "@context": "http://iiif.io/api/presentation/2/context.json",
                            "@id": "http://3e071cbb-e37e-49c9-8b60-4d996885f5e8",
                            "@type": "oa:Annotation",
                            "motivation": "sc:painting",
                            "resource": {
                                "@id": "https://iiif.archivelab.org/iiif/img-8664_202009/full/full/0/default.jpg",
                                "@type": "dctypes:Image",
                                "format": "image/jpeg",
                                "service": {
                                    "@context": "http://iiif.io/api/image/2/context.json",
                                    "@id": "https://iiif.archivelab.org/iiif/img-8664_202009$IMG_8664.jpg",
                                    "profile": [
                                        "http://iiif.io/api/image/2/level2.json"
                                    ]
                                },
                                "height": 3024,
                                "width": 4032
                            },
                            "on": "http://a292a51f-5975-497f-b9a4-8a962e380762-feb"
                        }
                    ],
                    "otherContent": [
                        {
                            "@id": "http://localhost:8887/annotations1.json",
                            "@type": "sc:AnnotationList",
                            "label": "My fantastic annotations"
                        }
                    ],
                    "related": ""
                }
            ]
        }
    ],
    "structures": []
}
dnoneill commented 3 years ago

@glenrobson Problem should be fixed now.