mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 14:53:14 +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['@context'] = "http://iiif.io/api/image/1.0/context.json";
|
||||||
options['@id'] = url.replace('/info.xml', '');
|
options['@id'] = url.replace('/info.xml', '');
|
||||||
return options;
|
return options;
|
||||||
} else if ( !data['@context'] ) {
|
} else {
|
||||||
|
if ( !data['@context'] ) {
|
||||||
data['@context'] = 'http://iiif.io/api/image/1.0/context.json';
|
data['@context'] = 'http://iiif.io/api/image/1.0/context.json';
|
||||||
data['@id'] = url.replace('/info.json', '');
|
data['@id'] = url.replace('/info.json', '');
|
||||||
return data;
|
}
|
||||||
} else {
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user