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

Windows: Extra files left in local root directory if targetWidth or targetHeight is specified to getPicture()

Open wifisher opened this issue 4 years ago • 0 comments

Bug Report

Problem

Extra files are left in the local root directory if targetWidth or targetHeight is specified to getPicture() on the Windows platform.

What is expected to happen?

Temporary or intermediate file should be deleted when no longer required. Or at a minimum, they should be created in a temporary folder.

What does actually happen?

A file remains in the local root directory. The name of the file is not available to the application so it has no ability to delete it without inspecting the local root directory.

Information

cordova-plugin-camera v5.0.0

Call getPicture() with targetWidth and/or targetHeight set to a non-zero value.

Command or Code

navigator.camera.getPicture( successFunc, failFunc, { sourceType: navigator.camera.PictureSourceType.CAMERA, destinationType: navigator.camera.DestinationType.FILE_URI, encodingType: navigator.camera.EncodingType.JPEG, quality: 75, targetWidth: 2048, targetHeight: 2048 });

The above call will leave a file named similar to CCapture.jpg in the local root directory. The application will receive a URI for a file named similar to camera_cordova_temp_return.jpg located in the local root directory.

If sourceType is set to navigator.camera.PictureSourceType.PHOTOLIBRARY, a file named to match the original source file will be left in the local root directory. The application will receive a URI for a file named similar to camera_cordova_temp_return.jpg located in the local root directory.

Environment, Platform, Device

Windows 10

Version information

"cordova-plugin-camera": "^5.0.0"
"cordova-windows": "^7.0.1"

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

wifisher avatar Sep 29 '20 17:09 wifisher