Donaldcwl / browser-image-compression

Image compression in web browser
MIT License
1.3k stars 160 forks source link

Add the ability to provide a fileType override in order to convert a given image during compression #25

Closed jadhaidar closed 4 years ago

jadhaidar commented 5 years ago

Scenario: project requirements expect a file input to compress all images selected as well as convert them to .jpeg format before uploading to server.

Solution: I added the ability to simply pass a fileType override through the options param before calling on the canvasToFile helper function.