added warning check for toDataURL, and also improved image buffer unit tests

This commit is contained in:
Eric Rowell
2012-11-28 22:19:49 -08:00
parent 8958fbffc6
commit 424e86bd2b
4 changed files with 44 additions and 22 deletions

View File

@@ -162,7 +162,7 @@ Kinetic.Image.prototype = {
});
}
catch(e) {
Kinetic.Global.warn('Unable to create image buffer.');
Kinetic.Global.warn('Unable to create image buffer. ' + e.message);
}
},
/**

View File

@@ -93,7 +93,13 @@ Kinetic.Canvas.prototype = {
return this.element.toDataURL(mimeType, quality);
}
catch(e) {
return this.element.toDataURL();
try {
return this.element.toDataURL();
}
catch(e) {
Kinetic.Global.warn('Unable to get data URL. ' + e.message)
return '';
}
}
}
};