fengyuanchen / cropperjs

JavaScript image cropper.
https://fengyuanchen.github.io/cropperjs/
MIT License
13.16k stars 2.42k forks source link

On IOS mobile browsers, when the height of the image is greater than 4531px, the image is corrupted after crop #1134

Closed LetTTGACO closed 10 months ago

LetTTGACO commented 10 months ago

Describe the error I should have mentioned it to react-cropper, but you're the one who maintains the core cuts, so I thought I'd mention it to you.

When using react-corpper on IOS mobile browsers, if the size height of the original image is greater than 4531px, the image fetched using cropper.getCroppedCanvas().toDataURL() is in corrupt state. To Reproduce Steps to reproduce the behavior:

  1. using the IOS mobile browser go to https://codesandbox.io/s/wonderful-pine-i7fs3
  2. Click Select File and select an image with a height of greater than 4531px
  3. use base64 of the image obtained using cropper.getCroppedCanvas().toDataURL() is corrupted

Expected behavior A concise description of what you expect to happen. The image base64 fetched by cropper.getCroppedCanvas().toDataURL() should be the normal cropped image

Screenshots The first one is an image whose height is less than 4531px, the second one is an image whose height is more than 4531, and the background is gray after clicking crop.

https://github.com/fengyuanchen/cropperjs/assets/37357188/ed238ad9-739d-4440-bcdc-58a7baa3fb42

Smartphone (please complete the following information):

Additional context Here's a test image: https://image.1874.cool/1874/202401181613918.jpg

fengyuanchen commented 10 months ago

See the known issues.