m1
m1 copied to clipboard
Support of empty canvases
Use case "Florus dispersus": reconstructed manifest of a disbound manuscript, with some known lacunae => the viewer should be able to render the information about emptiness, e.g. displaying empty canvases in thumbnailView/scrollView and showing relevant info message in imageView.
(issue related to #71 to some extent: Mirador should support manifests with no IIIF image service and no image annotation at all for a given canvas). Maybe not absolutely necessary for a stable RC 1.0 release.
Agree related to #71. Agree not 1.0 but a high priority.
For example, the director of the Medieval Academy of America yesterday: http://twitter.com/lisafdavis/status/428288563214417920
Where Shared Canvas/IIIF will be discussed
R
On Wed, Jan 29, 2014 at 9:38 AM, regisrob [email protected] wrote:
Use case "Florus dispersus": reconstructed manifest of a disbound manuscript, with some known lacunae => the viewer should be able to render the information about emptiness, e.g. displaying empty canvases in thumbnailView/scrollView and showing relevant info message in imageView.
(issue related to #71 https://github.com/IIIF/mirador/issues/71 to some extent: Mirador should support manifests with no IIIF image service _and_no image annotation at all for a given canvas). Maybe not absolutely necessary for a stable RC 1.0 release.
Reply to this email directly or view it on GitHubhttps://github.com/IIIF/mirador/issues/83 .
Here is the manifest of the virtual reconstruction of the "Florus dispersus" manuscript (http://demos.biblissima-condorcet.fr/iiif/metadata/florus-dispersus/manifest.json) (see Mirador demo, showing the known lacunae w/ empty canvases and the internal codicological/intellectual structure by means of ranges).
Possible fixture object for this ticket and this one in the new repo: Presentation API 2.0 support for ranges and table of contents display
NB:
- images coming from e-codices and Gallica
- empty canvases: no "images" property and fictive height/width to be compliant with P-API [1]
[1] The data model supports this use case, and the cardinality between Canvas and Content is (0..*) according to P-API, but on the other hand the spec says that height and a width are mandatory. P-API 2.0: "Each canvas should have one or more content resources associated with it. Zero is possible but unlikely; it represents the case where the page exists (or existed) but has not been digitized." => this is a case of unlikelihood :blush: (ping @azaroth42)
I have this working, but it is a bit tricky and hacky. It involves fixes in a couple places.
1.) getImageURL() in iiif.js: Add the following code to check if there is no image at all. If an image is missing, use an img not found for your site if(!image.images[0]){ id = "http://mySite/myProj/images/imgNotFound.png"; return id; } else if (!image.images[0].resource.service){ ...
2.) getThumbnailForCanvas() in manifest.js
There is no support for if canvas.images[0] is undefined or empty. To set the resource, I added this code:
if(canvas.images[0] === undefined || canvas.images[0] === ""){
//place a holder resource.
resource = {
"@id":"http://mySite/myProj/images/imgNotFound.png",
"format":"image/jpg",
"@type":"dctypes:Image",
"service":
{
"@context": "http://iiif.io/api/image/2/context.json",
"profile":"http://iiif.io/api/image/2/profiles/level2.json",
"@id" : "http://mySite/myProj/images/imgNotFound.png"
},
"width": 667,
"height":1000
};
}
else{
resource = canvas.images[0].resource;
}
...
3.) Most importantly, createOpenSeaDragon has no check for failure to get an image service which is what builds the single image view in a slot. You have to tell this function that not having an image is OK.
I altered it like so:
jQuery.getJSON(infoJsonUrl).done(function (infoJson, status, jqXHR) {
...
})
.fail(function(){
//Same code as done, except change how the osd component is built
_this.osd = $.OpenSeadragon({
'id': osdID,
'tileSources': [], // Just pass an empty array. You will not have zoom() and pan() becaue viewport will not be built, but you have everything else.
'uniqueID' : uniqueID
});
});
...
//Then after the rest of the code runs, since OSD could not build a canvas, put an image in instead
var fakeCanvas = img with imageURL parameter from function parameters;
fakeCanvas = $(fakeCavas);
jQuery(_this.osd.canvas).append(fakeCanvas);
This allows me to use non-IIIF images and support IIIF canvases without images by placing a holder resource in instead.
P.S. There are probably more locations that do not check for canvas.images == undefined or canvas.images[0] == undefined or canvas.images[0] !== "" (like in bookView.js) that I have missed. I am only concerned with imageView.js at the moment.