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 is black in IPhone 8 #98

Closed
a-m-dev opened this issue Feb 17, 2020 · 5 comments
Closed

canvas is black in IPhone 8 #98

a-m-dev opened this issue Feb 17, 2020 · 5 comments

Comments

@a-m-dev
Copy link

a-m-dev commented Feb 17, 2020

hi there , tnx for creating this really awesome package

as much as i use this great pkg, i really love i but i had faced with 2 issue for almost in passed five days, every thing is awesome in android phone except:

SAMSUNG A30

only issue is that picture is 90 degree rotated even by using rotation = 0

iPhone 8

just because that iphone tooks pictures around 4k resolution i have an warning in my console in safari that its more than allocated memory to create canvas for that resolution, i think that at the first level it is because of image resolution and at the second its because of the safe area that we create to crop image

there for the canvas (i.e. 1000x1000px) is created , but it is black! and when i', converting it to blob to wire it trough api, it just sends a black image...

please help!

@a-m-dev a-m-dev changed the title canvas is black in IPhone canvas is black in IPhone 8 Feb 17, 2020
@ValentinH
Copy link
Owner

For the Samsung issue, it's the same as https://github.com/ricardo-ch/react-easy-crop/issues/95

For iOS, this is a known issue and you need to make the canvas smaller.

@a-m-dev
Copy link
Author

a-m-dev commented Feb 17, 2020

even by testing https://codesandbox.io/s/y09komm059 codesandbox sample you provided in iPhone 8 the canvas is black and my logs says this:

Canvas Area exceeds the maximum limit (width * height > 16777216)

@a-m-dev
Copy link
Author

a-m-dev commented Feb 17, 2020

how can i make the canvas smaller? any hint ? to preserve aspect ration and not cut image that dod NOT contains black parts??
any code snippet would be appreciated!

@ValentinH
Copy link
Owner

You can use something like this https://github.com/nodeca/pica to resize the image before cropping it.

Canvas manipulations are tricky and are not supported by this library. When I see the bugs that are becoming frequent with latest iphones, I'm happy I didn't implement that as part of this library.

I'm sorry but I can't help you more than telling you to either update the canvas handling example (make it smaller somehow) or use another library to resize the image before cropping it.

@ValentinH
Copy link
Owner

I'm closing this as this is not a bug or something that can be done as part of the library.

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

2 participants