mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Merge pull request #1656 from buda-base/fix-1655
add support for iiif preferredFormats
This commit is contained in:
commit
079ae0fdcb
@ -202,11 +202,19 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
||||
options['@context'] = "http://iiif.io/api/image/1.0/context.json";
|
||||
options['@id'] = url.replace('/info.xml', '');
|
||||
return options;
|
||||
} else if ( !data['@context'] ) {
|
||||
data['@context'] = 'http://iiif.io/api/image/1.0/context.json';
|
||||
data['@id'] = url.replace('/info.json', '');
|
||||
return data;
|
||||
} else {
|
||||
if ( !data['@context'] ) {
|
||||
data['@context'] = 'http://iiif.io/api/image/1.0/context.json';
|
||||
data['@id'] = url.replace('/info.json', '');
|
||||
}
|
||||
if(data.preferredFormats) {
|
||||
for (var f = 0; f < data.preferredFormats.length; f++ ) {
|
||||
if ( OpenSeadragon.imageFormatSupported(data.preferredFormats[f]) ) {
|
||||
data.tileFormat = data.preferredFormats[f];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user