Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas toBlob crop not working on Sandbox (iOS) #574

Open
tylerjbainbridge opened this issue Jan 8, 2024 · 3 comments
Open

Canvas toBlob crop not working on Sandbox (iOS) #574

tylerjbainbridge opened this issue Jan 8, 2024 · 3 comments

Comments

@tylerjbainbridge
Copy link

tylerjbainbridge commented Jan 8, 2024

I've been wrestling with the canvas logic for getting the cropped image on Mobile Safari and toBlob/toDataURL consistently return null.

I thought it might be something with my own product code, but it appears that the same issue happens on the code sandbox within the IOS Simulator. Very easy to reproduce on an iPhone 15 simulator using the Sandbox url.

Does anyone have a work around?

Screenshot 2024-01-08 at 12 35 20 PM
@tylerjbainbridge tylerjbainbridge changed the title Canvas toBlob crop not working on Sandbox Canvas toBlob crop not working on Sandbox (iOS) Jan 8, 2024
@mnfwu
Copy link

mnfwu commented Jan 15, 2024

I've run into this same issue for mobile users on Safari with the preview canvas toBlob method failing to return a blob. It had been working well for months, but on January 10 we started receiving bug reports, all from users on mobile Safari browser and iOS version >17.0.

The behavior I've seen is like in @tylerjbainbridge's screenshot above, where the preview canvas does not populate with an image when the image is first selected. This seems to be happening more often with larger images.

Thanks for looking into this issue, we're also keen to know if anyone's found a work around or a source of the issue.

@sekoyo
Copy link
Owner

sekoyo commented Jan 15, 2024

Are you able to replicate the issue? There was a "Canvas lost" error regression in iOS 17 that was fixed in a patch, wondering if you are able to see what error is in the console

@tylerjbainbridge
Copy link
Author

I included replication instructions in the issue- very easy to reproduce it.

I believe it has to do with Safari/iOS having a max size for canvases and any larger image (basically anything taken on an iPhone) causes toBlob to quietly fail and return null.

I ended up having to move my image cropping to the server because this bug was effecting so many users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants