Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

for matching .png.JPG as jpeg

  • Loading branch information...
commit b636282a84585025a0ee5edee8949a371a7b8140 1 parent d80c4e5
@MarkVaughn authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 assets/jquery.imageCache.js
View
4 assets/jquery.imageCache.js
@@ -40,9 +40,9 @@
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
- var imgType = img.src.match(/(jpg|jpeg|png)/);
+ var imgType = img.src.match(/\.(jpg|jpeg|png)$/i);
if (imgType && imgType.length) {
- imgType = imgType[0] == 'jpg' ? 'jpeg' : imgType[0];
+ imgType = imgType[0].toLowerCase() == 'jpg' ? 'jpeg' : imgType[0].toLowerCase();
} else {
throw 'Invalid image type for canvas encoder: ' + img.src;
}
Please sign in to comment.
Something went wrong with that request. Please try again.