-
Notifications
You must be signed in to change notification settings - Fork 175
Images are converted to all black after compression on IPad pro #222
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
Comments
Yes I think the solution will require other means of browser/device detection that does not depend on the user agent.. more context: https://stackoverflow.com/questions/57776001/how-to-detect-ipad-pro-as-ipad-using-javascript |
Any update on this? I'm seeing the same. |
Hi @nrathi, not sure if this repo is actively maintained. I have a fix for this in my fork here: https://github.com/Russell-Pollari/browser-image-compression/tree/fix-for-ipad |
@Russell-Pollari Amazing. While I have you... do you have any guidance on how to effectively process many hi-res images on mobile? I just need a basic first-pass compression before sending images over the wire. I'm trying to get iPhone images that are ~12MB down to something more reasonable like 2MB. Then I use Sharp to normalize the images server-side.
I'm using |
@nrathi you might hit resource constraints if you try too many in parallel. Maybe try batching? |
No errors thrown, but image is uploaded as a black square.
I think the root cause is that the user agent string on an iPad pro presents as a Mac.
Since the user agent determines the browser and the max canvas size, this would mean that the library is assuming the wrong maximum canvas size for the Ipad.
I don't have an IPad pro myself to test on, this was reported by a customer. Will continue to do some debugging and update it here.
If you have an iPad pro and can share what the user agent is, that would be very helpful!
The text was updated successfully, but these errors were encountered: