fengyuanchen / compressorjs

JavaScript image compressor.
https://fengyuanchen.github.io/compressorjs/
MIT License
5.23k stars 438 forks source link

Compression not working on ios (webp) #172

Closed iamkotu closed 1 year ago

iamkotu commented 1 year ago

Describe the bug Hi. When mimeType is set to 'image/webp' on the phone the output image has a png extension. The error occurs on ios 16.3.1. I tested on chrome and safari on iphone 11 pro

Screenshots image 123

Additional context I tried with different file sizes.

No problem on other android devices

fengyuanchen commented 1 year ago

Currently, Safari for iOS (16.4) does NOT support HTMLCanvasElement.toBlob(callback, 'image/webp', quality).

Reference: https://caniuse.com/mdn-api_htmlcanvaselement_toblob_type_parameter_webp