Merge pull request #1193 from cycomachead/fix-blob-images

Fix #1191; Fix #1174 Comment out `Canvas.toBlob()`
dev
Jens Mönig 2016-05-02 12:58:29 +02:00
commit 01648b3b4e
1 zmienionych plików z 13 dodań i 9 usunięć

22
gui.js
Wyświetl plik

@ -3842,15 +3842,19 @@ IDE_Morph.prototype.saveFileAs = function (
IDE_Morph.prototype.saveCanvasAs = function (canvas, fileName, newWindow) {
// Export a Canvas object as a PNG image
// cavas.toBlob() is currently only supported in Firefox and IE
var myself = this;
if (canvas.toBlob) {
canvas.toBlob(function (blob) {
myself.saveFileAs(blob, 'image/png', fileName, newWindow);
});
} else {
this.saveFileAs(canvas.toDataURL(), 'image/png', fileName, newWindow);
}
// Note: This commented out due to poor browser support.
// cavas.toBlob() is currently supported in Firefox, IE, Chrome but
// browsers prevent easily saving the generated files.
// Do not re-enable without revisiting issue #1191
// if (canvas.toBlob) {
// var myself = this;
// canvas.toBlob(function (blob) {
// myself.saveFileAs(blob, 'image/png', fileName, newWindow);
// });
// return;
// }
this.saveFileAs(canvas.toDataURL(), 'image/png', fileName, newWindow);
};
IDE_Morph.prototype.saveXMLAs = function(xml, fileName, newWindow) {