Load demo images locally (to prevent SOP errors when serializing an image).

This commit is contained in:
kangax 2010-08-02 11:00:38 -04:00
parent 7e7a7ff719
commit 37abb1b8d8
4 changed files with 4 additions and 4 deletions

View file

@ -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;

BIN
test/demo/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
test/demo/assets/pug.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

View file

@ -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);
});