diff --git a/src/image.class.js b/src/image.class.js index 07839195..bf36736e 100644 --- a/src/image.class.js +++ b/src/image.class.js @@ -80,7 +80,7 @@ normalizedWidth = ~~((oImg.width * maxheight) / oImg.height); normalizedHeight = maxheight; } - else if (maxwidth && (maxwidth < oImg.width)){ + else if (maxwidth && (maxwidth < oImg.width)) { // width is the constraining dimension. normalizedHeight = ~~((oImg.height * maxwidth) / oImg.width); normalizedWidth = maxwidth; diff --git a/test/demo/assets/logo.png b/test/demo/assets/logo.png new file mode 100644 index 00000000..6eda4e4c Binary files /dev/null and b/test/demo/assets/logo.png differ diff --git a/test/demo/assets/pug.jpg b/test/demo/assets/pug.jpg new file mode 100644 index 00000000..8807b663 Binary files /dev/null and b/test/demo/assets/pug.jpg differ diff --git a/test/demo/demo.js b/test/demo/demo.js index 38814508..e11bd321 100644 --- a/test/demo/demo.js +++ b/test/demo/demo.js @@ -76,14 +76,14 @@ break; case 'image1': - fabric.Image.fromURL('http://www.dooziedog.com/dog_breeds/pug/images/full/Pug-Puppy.jpg', function(image) { - image.set('left', left).set('top', top).set('angle', angle).scale(getRandomNum(0.05, 0.25)).setCoords(); + fabric.Image.fromURL('assets/pug.jpg', function(image) { + image.set('left', left).set('top', top).set('angle', angle).scale(getRandomNum(0.1, 0.25)).setCoords(); canvas.add(image); }); break; case 'image2': - fabric.Image.fromURL('http://www.google.com/intl/en_ALL/images/srpr/logo1w.png', function(image) { + fabric.Image.fromURL('assets/logo.png', function(image) { image.set('left', left).set('top', top).set('angle', angle).scale(getRandomNum(0.1, 1)).setCoords(); canvas.add(image); });