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

getCroppedCanvas is producing a blank or corrupt image on some devices first time #1036

Closed
crawft opened this issue Jan 31, 2023 · 9 comments

Comments

@crawft
Copy link

crawft commented Jan 31, 2023

Describe the bug
getCroppedCanvas is producing a blank or corrupt image on some devices first time

To Reproduce

go to https://fengyuanchen.github.io/cropperjs/
click Get Cropped Canvas
(result is blank first time, subsequent times it works)

Smartphone (please complete the following information):

  • Device: Samsung S8
  • OS: Android 9
  • Chrome
  • 109

Additional context
We see this only on some devices in our app (where the result is a corrupt image) and have been able to reproduce on the above device with the demo site (where the result is a blank canvas)

Screenshot_20230131-081837_Chrome

@fengyuanchen
Copy link
Owner

Out of memory?

@mutedMike
Copy link

mutedMike commented Feb 15, 2023

Same thing happens on my Samsung S8 - Android 9 and Samsung A41 - Android 10.
Although to recreate that it needs to be a brand new chrome tab - after refreshing the page getCroppedCanvas works fine already the first time

@gaileli
Copy link

gaileli commented Feb 22, 2023

I'm having a similar problem with my application, on chrome on an android device, only the first time you load a new browser window, except in my case the cropped image is upside down and off center.

@miklosz
Copy link

miklosz commented Apr 7, 2023

Reproduced on Samsung M21, Android 12 and Google Pixel 7.
It only occurs on the first attempt (first time page is loaded), on following attempts works as expected.

Maybe some functions are being executed before the script is fully loaded?

@fengyuanchen
Copy link
Owner

@miklosz Maybe you can try to initialize the Cropper after all things are ready (loaded or prepared).

@miklosz
Copy link

miklosz commented Apr 11, 2023

@fengyuanchen you might have misunderstood me. I reproduced this behaviour on devices as mentioned above on the demo site https://fengyuanchen.github.io/cropperjs/, so it's not my code ;-)

@fengyuanchen
Copy link
Owner

fengyuanchen commented Apr 15, 2023

@miklosz You might have to help yourself because I don't have these devices for debugging.

A possible case: The page was not loaded completely when you click the Get Cropped Canvas button.

@indyger
Copy link

indyger commented May 29, 2023

I have the same problem and try'd a lot to fix it. Nothing seems to help. I created a discusion-post some hours ago, because i don't find anything else. Some minutes ago, i saw this issue. It appears only in mobiles and seems only happen in Chrome and Brave on Samsung phones. I add here also the screenshot. Maybe it helps something?
Folie1

@indyger
Copy link

indyger commented Jul 25, 2023

After a break, i wanted to retry to fix this issue and i can't reproduce it anymore on Chrome. Some days ago, a chrome-android update was released. So, on Chrome, on every of my mobile phone, it workes like a charme. On Brave, with the same chromium version, the bug is active. Really strange.....

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

No branches or pull requests

6 participants