Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case-insensitive regexes for checking image extensions #270 #278

Merged
merged 4 commits into from
May 9, 2017
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be !supportedExtensions.test(ext)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like me and @mramato replied at about the same time.

Copy link
Contributor Author

@ryki2658 ryki2658 May 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mramato @lilleyse Silly mistake sorry . I appreciate the patience with me muddling my way through this first attempt at GitHub and my first attempt at contributing to a "real" project. I hope I haven't been to much of a disturbance in the operation of things for everyone. Thank you for allowing me to participate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't be so hard on yourself. We are were all first time committers at some point. We are happy to help and appreciate your help.

return Promise.resolve();
}

Expand Down