Donaldcwl / browser-image-compression

Image compression in web browser
MIT License
1.31k stars 161 forks source link

Images are converted to all black after compression on IPad pro #222

Open Russell-Pollari opened 3 months ago

Russell-Pollari commented 3 months ago

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!

Russell-Pollari commented 3 months ago

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