This commit is contained in:
Marco Castelluccio 2014-11-05 01:10:18 +01:00
Родитель 688c7f1ed8
Коммит dae9d9c94d
1 изменённых файлов: 1 добавлений и 11 удалений

Просмотреть файл

@ -520,12 +520,6 @@ NokiaImageProcessingLocalMsgConnection.prototype.sendMessageToServer = function(
return;
}
console.log("fileName: " + fileName);
console.log("max_vres: " + max_vres);
console.log("max_hres: " + max_hres);
console.log("aspect: " + aspect);
console.log("quality: " + quality);
fs.open("/" + fileName, (function(fd) {
var imgData = fs.read(fd);
fs.close(fd);
@ -533,9 +527,6 @@ NokiaImageProcessingLocalMsgConnection.prototype.sendMessageToServer = function(
var img = new Image();
img.src = URL.createObjectURL(new Blob([ imgData ]));
img.onload = (function() {
console.log("width: " + img.naturalWidth);
console.log("height: " + img.naturalHeight);
var canvas = document.createElement("canvas");
canvas.width = Math.min(img.naturalWidth, max_hres);
canvas.height = Math.min(img.naturalHeight, max_vres);
@ -546,8 +537,6 @@ NokiaImageProcessingLocalMsgConnection.prototype.sendMessageToServer = function(
createUniqueFile("/nokiaimageprocessing", "image", blob, (function(fileName) {
var encoder = new DataEncoder();
console.log("CREATED: " + fileName);
encoder.putStart(DataType.STRUCT, "event");
encoder.put(DataType.METHOD, "name", "Scale");
encoder.put(DataType.BYTE, "trans_id", trans_id);
@ -564,6 +553,7 @@ NokiaImageProcessingLocalMsgConnection.prototype.sendMessageToServer = function(
}).bind(this));
}).bind(this), "image/jpeg", quality / 100);
}).bind(this);
img.onerror = function(e) {
console.error("Error in decoding image");
};