Skip to content

Canvases are not upgraded from Presi 2 when isolated in upgrader #53

@cubap

Description

@cubap

I encountered this when using Vault to load "https://t-pen.org/TPEN/canvas/13250383", a Presi 2 Canvas, as a test for my interface. It landed here:

Error: Resource type is not known
    at Ye (chunk-W3DWL6UZ.js:1:781)
    at e.traverseUnknown (chunk-W3DWL6UZ.js:1:7350)
    at Ut (chunk-HF3WYIOE.js:1:9547)
    at chunk-EIMQCVDV.js:18:43
    at u (chunk-EIMQCVDV.js:162:26)
    at chunk-EIMQCVDV.js:171:20
    at async AnnotoriousAnnotator.processCanvas (line-parser.js:366:24)

The upgrader sees "sc:Canvas" and strips the prefix

function removePrefix(str: string) {
for (const prefix of ['sc', 'oa', 'dcterms', 'dctypes', 'iiif']) {
if (str.startsWith(`${prefix}:`)) {
return str.slice(prefix.length + 1);
}
}
return str;
}

At

const knownTypes = ['Collection', 'Manifest', 'Annotation', 'AnnotationPage', 'Range', 'Service'];
the knownTypes do not include "Canvas" so I am led to believe that a either a Presi 2 Canvas can only be upgraded within the processing of a Manifest or that (because it tends to be forwards-compatible) it is just not handled and has tended to work.

I can put some time against this, but not immediately. If there are any intellects that can shorten the path to success with bits of advice, I'd ratehr contribute back to iiif-helpers than just get it working on my machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions