mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 22:26:10 +03:00
Merge pull request #1954 from pandaxtc/set_formats_supported
Create setImageFormatsSupported function
This commit is contained in:
commit
dfd4ea3b04
@ -2453,6 +2453,31 @@ function OpenSeadragon( options ){
|
||||
extension = extension ? extension : "";
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
return !!FILEFORMATS[ extension.toLowerCase() ];
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates supported image formats with user-specified values.
|
||||
* Preexisting formats that are not being updated are left unchanged.
|
||||
* By default, the defined formats are
|
||||
* <pre><code>{
|
||||
* bmp: false,
|
||||
* jpeg: true,
|
||||
* jpg: true,
|
||||
* png: true,
|
||||
* tif: false,
|
||||
* wdp: false
|
||||
* }
|
||||
* </code></pre>
|
||||
* @function
|
||||
* @example
|
||||
* // sets webp as supported and png as unsupported
|
||||
* setImageFormatsSupported({webp: true, png: false});
|
||||
* @param {Object} formats An object containing format extensions as
|
||||
* keys and booleans as values.
|
||||
*/
|
||||
setImageFormatsSupported: function(formats) {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
$.extend(FILEFORMATS, formats);
|
||||
}
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user