Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of empty canvases #83

Open
regisrob opened this issue Jan 29, 2014 · 3 comments
Open

Support of empty canvases #83

regisrob opened this issue Jan 29, 2014 · 3 comments

Comments

@regisrob
Copy link

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.

@azaroth42
Copy link
Contributor

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 ProjectMirador/mirador#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/ProjectMirador/mirador/issues/83
.

@snydman snydman added this to the Icebox milestone Mar 19, 2014
@regisrob
Copy link
Author

regisrob commented Jul 3, 2015

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 😊 (ping @azaroth42)

@thehabes
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants