Skip to content

Commit

Permalink
Merge pull request #278 from ryki2658/master
Browse files Browse the repository at this point in the history
Case-insensitive regexes for checking image extensions #270
  • Loading branch information
mramato authored May 9, 2017
2 parents ce48e5f + ad02448 commit 94b89ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/loadGltfUris.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ function readFromFile(object, name, uriPath) {
});
}

var jimpSupportedExtensions = ['.png', '.jpg', '.jpeg', '.bmp'];

var supportedExtensions = /\.(jpg|jpeg|bmp|png)$/i;
/**
* Generate a jimp image for png, jpeg, or bmp.
*
Expand All @@ -169,7 +168,7 @@ var jimpSupportedExtensions = ['.png', '.jpg', '.jpeg', '.bmp'];
function generateJimpImage(object) {
var pipelineExtras = object.extras._pipeline;
var ext = pipelineExtras.extension;
if (jimpSupportedExtensions.indexOf(ext) === -1) {
if (!supportedExtensions.test(ext)) {
return Promise.resolve();
}

Expand Down

0 comments on commit 94b89ab

Please sign in to comment.