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

IOS Chrome Crop big size #477

Open
evanoralph opened this issue Apr 16, 2022 · 7 comments
Open

IOS Chrome Crop big size #477

evanoralph opened this issue Apr 16, 2022 · 7 comments

Comments

@evanoralph
Copy link

evanoralph commented Apr 16, 2022

Hi i found a bug on ios mobile that when i select a larger crop the canvas will now show the preview but when i select a small one its working
7D2641B6-B2AF-4376-B625-C4061CB0FA7E
Skype_Picture_2022_04_16T18_54_39_646Z

is there any one already know how to fix this ?

@Finki007
Copy link

Hello,
I do have the same bug.
@evanoralph Did you found a workaround?
Regards

@dominictobias
Copy link
Owner

dominictobias commented Apr 20, 2022 via email

@Finki007
Copy link

Indeed it is an bug (maybe they will call it a feature) in Safari:
https://pqina.nl/blog/canvas-area-exceeds-the-maximum-limit/

@dominictobias
Copy link
Owner

dominictobias commented Apr 20, 2022

Indeed it is an bug (maybe they will call it a feature) in Safari: https://pqina.nl/blog/canvas-area-exceeds-the-maximum-limit/

Ah I see! Not much we can do about that then. Maybe you load the image with https://github.com/blueimp/JavaScript-Load-Image/

and set a max width: https://github.com/blueimp/JavaScript-Load-Image/#image-scaling ?

Or you could just ensure the crop container is not above a certain size?

@Finki007
Copy link

@dominictobias @evanoralph I could fix it by setting the ratio to 0.5:
const pixelRatio = 0.5
instead of
const pixelRatio = window.devicePixelRatio
in canvasPreview.ts

@evanoralph
Copy link
Author

@dominictobias sorry i did not specify the platform , i was using and IOS phone with google chrome browser i think @Finki007 is right since the iphone have retina resolution the crop image is to big to display when selecting a large chuck on the image ill try @Finki007 solution i think we cannot do anything about the limit

@paintoshi
Copy link

As @Finki007 said. It worked for me too, but I just set the pixelRatio to 1

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

4 participants