benwbrum / fromthepage

FromThePage is a wiki-like application for crowdsourcing transcription of handwritten documents.
http://fromthepage.com
GNU Affero General Public License v3.0
170 stars 49 forks source link

Allow import of IIIF manifests with non-standard IIIF images on canvas #1112

Open bencomp opened 6 years ago

bencomp commented 6 years ago

I have a manifest in which many canvases contain partial IIIF Image resources, expressed as oa:SpecificResource. For example:

"resource": {
    "default": {
        "@type": "dctypes:Image",
        "format": "image/jpeg",
        "service": {
            "@context": "http://iiif.io/api/image/2/context.json",
            "@id": "https://digitalscholarship.nl/iiif/2/UBLWHS_BPL_14_A_0000_opening01.ptif",
            "profile": "http://iiif.io/api/image/2/level2.json"
        },
        "@id": "https://digitalscholarship.nl/iiif/2/UBLWHS_BPL_14_A_0000_opening01.ptif/full/full/0/default.jpg"
    },
    "@type": "oa:SpecificResource",
    "selector": {
        "@type": "iiif:ImageApiSelector",
        "@context": "http://iiif.io/api/annex/openannotation/context.json",
        "region": "0,0,2900,4122"
    },
    "@id": "https://digitalscholarship.nl/iiif/2/UBLWHS_BPL_14_A_0000_opening01.ptif/0,0,2900,4122/full/0/default.jpg"
}

This follows the Presentation API version 2.1, except for the use of default instead of full for Mirador (Projectmirador/mirador#1467).

Trying to import the manifest that has this resource fails because FromThePage expects a service object directly under resource: https://github.com/benwbrum/fromthepage/blob/a58096fd0c15a64169340288df327962a0978d9c/app/models/sc_manifest.rb#L115.

This means that other image types, like images that are not served via the IIIF Image API, are not supported either.

It would be great if FromThePage could check for the type of image resource before expecting an Image API image.

benwbrum commented 6 years ago

How do other IIIF clients like Mirador or UV behave when they encounter these kinds of images?

bencomp commented 6 years ago

Mirador supports this in the newest versions (2.5+), but only in single-page view, UV does not support it at all.

saracarl commented 4 years ago

@bencomp do you have a link to a manifest we can use to reproduce this? Thanks!