jr-crop icon indicating copy to clipboard operation
jr-crop copied to clipboard

Seems it doesn't have canvas size limit check?

Open llamerr opened this issue 9 years ago • 0 comments

So when I'm taking photo and selecting max size that I can select - canvas size is set to values that is not supported by my IPhone.

canvas.width = this.options.width / this.scale;
canvas.height = this.options.height / this.scale;

width is set to 2448, height is set to 3264, which is almost 8MPx and canvas is become broken (empty or something) http://stackoverflow.com/a/22345796/319375

I'm fixed it by this code

canvas.width = 640;//this.options.width / this.scale;
canvas.height = 640;//this.options.height / this.scale;
-----------
context.drawImage(this.imgFull, -sourceX, -sourceY, this.options.width/this.scale, this.options.height/this.scale, 0, 0, 640, 640);

Is there plans to add some global fix for this? I may add PR later when I figure out how to make it work universally (not just 640x640 I'm interesting in)

llamerr avatar Jan 27 '16 11:01 llamerr