Commit 91c7d659 by doszhang

dos

parent 5260b6a7
...@@ -433,10 +433,17 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) { ...@@ -433,10 +433,17 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
} }
function bindUpload(that, ctx, myCanvas, index, callback, imgInfo) { function bindUpload(that, ctx, myCanvas, index, callback, imgInfo) {
imgInfo.rotation = 0; imgInfo = {
imgInfo.x = 0; x: 0,
imgInfo.y = 0; y: 0,
imgInfo.scale = 2; scale: 1,
rotation: 0
}, oldpoz = {
x: 0,
y: 0,
scale: 1,
rotation: 0
}
event.preventDefault(); event.preventDefault();
var imgData = that.files[0]; var imgData = that.files[0];
EXIF.getData(imgData, function () { EXIF.getData(imgData, function () {
...@@ -455,21 +462,16 @@ function bindUpload(that, ctx, myCanvas, index, callback, imgInfo) { ...@@ -455,21 +462,16 @@ function bindUpload(that, ctx, myCanvas, index, callback, imgInfo) {
default: default:
imgInfo.rotation = 0; imgInfo.rotation = 0;
} }
if (navigator.userAgent.indexOf('iPhone') > -1) { var objectImg = new Image();
imgInfo.rotation = 0; objectImg.crossOrigin = "Anonymous";
objectImg.setAttribute('crossOrigin', 'anonymous');
objectImg.onload = function () {
if (rotation === 90 || rotation === 270) {
width = objectImg.height;
height = objectImg.width;
}
drawImage(ctx, myCanvas, objectImg, imgInfo);
} }
lrz(imgData, {
width: 640
}, function (results) {
img = new Image();
img.onload = function () {
drawImage(ctx, myCanvas, img, imgInfo);
results = null;
imgData = null;
};
img.src = results.base64;
callback(img);
});
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment