cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

Windows - Improvements to take into account quality option & improved error handling

Open RebusMediaJTH opened this issue 5 years ago • 0 comments

Information

In CameraProxy.js, whenever canvas.toDataURL is called, you can specify the quality for JPEG.

canvas.toDataURL('image/jpeg', 0.75); (Basically, the quality / 100)

Also, whenever image.onload is handled, it should also be handling image.onerror

At the moment, if there's an error at this point, onload is not called and no callback is made. (A way to test this is to suffix something like a text or pdf file with .png or .jpeg).

Edit: Also in resizeImageBase64, the canvas.toDataURL call is using file.contentType, it should instead be using the target type specified in the options, as does the resizeImage method.

Environment, Platform, Device

Windows 10 desktop

Version information

Latest

Checklist

  • [ x] I searched for existing GitHub issues
  • [ x] I updated all Cordova tooling to most recent version
  • [ x] I included all the necessary information above

RebusMediaJTH avatar Sep 14 '20 08:09 RebusMediaJTH