Image Dimensions Fix

If the image has a valid width and height, use it. Otherwise, the
off-screen rendering creates an image that is the maximum size of the
browser window. This can be seen on with large images that are greater
than the size of the browser window.
This commit is contained in:
Barrett Harber 2013-11-27 18:03:09 -05:00
parent 178dd7313b
commit f7ee54762d

View file

@ -217,7 +217,7 @@ var Pixastic = (function() {
var w = img.offsetWidth; var w = img.offsetWidth;
var h = img.offsetHeight; var h = img.offsetHeight;
if (imageIsCanvas) { if (imageIsCanvas || (img.width && img.height)) {
w = img.width; w = img.width;
h = img.height; h = img.height;
} }