cropperjs
cropperjs copied to clipboard
getCroppedCanvas is producing a blank or corrupt image on some devices first time
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)
Out of memory?
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
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.
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?
@miklosz Maybe you can try to initialize the Cropper after all things are ready (loaded or prepared).
@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 ;-)
@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.
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?
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.....