Skip to content

Commit

Permalink
fallback to jpg when no format detected (#296)
Browse files Browse the repository at this point in the history
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
  • Loading branch information
tech4GT authored and jywarren committed Jul 1, 2018
1 parent 510cf34 commit 0c01473
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
13 changes: 12 additions & 1 deletion dist/image-sequencer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50148,7 +50148,18 @@ module.exports = function GetFormat(src) {

if (format === "jpeg") format = "jpg";

return format;
function validateFormat(data){
let supportedFormats = [
'jpg',
'jpeg',
'png',
'gif',
'canvas',
];
return supportedFormats.includes(data);
}

return validateFormat(format)?format:'jpg';

}

Expand Down
2 changes: 1 addition & 1 deletion dist/image-sequencer.min.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion src/util/GetFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ module.exports = function GetFormat(src) {

if (format === "jpeg") format = "jpg";

return format;
function validateFormat(data){
let supportedFormats = [
'jpg',
'jpeg',
'png',
'gif',
'canvas',
];
return supportedFormats.includes(data);
}

return validateFormat(format)?format:'jpg';

}

0 comments on commit 0c01473

Please sign in to comment.