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

(windows) Fixes apache/cordova-plugin-camera#667

Open wifisher opened this issue 4 years ago • 3 comments

Platforms affected

Windows

Motivation and Context

The plugin was leaving lots of temporary files around in the local root directory. This PR adds code to delete these temporary files.

https://github.com/apache/cordova-plugin-camera/issues/667

Description

The changes are primarily to add calls to deleteAsync() after a file is no longer needed. It cleans up the original captured picture from the camera after that file has been copied or encoded into a base64 string.

It also places the copy made during rescaling into the temporary folder location instead of the local folder.

Testing

I have tested it within my app. Four combinations of options were tested for the getPicture() API:

  1. FILE_URI and resize
  2. FILE_URI and no resize
  3. DATA_URI and resize
  4. DATA_URI and no resize.

I also monitored the files stored at the root locations of the local and temporary folder locations to confirm that none of the temporary files were left behind.

Checklist

  • [ ] I've run the tests to see all new and existing tests pass
  • [ ] I added automated test coverage as appropriate for this change
  • [x] Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • [ ] I've updated the documentation if necessary

wifisher avatar Sep 29 '20 20:09 wifisher

Any chance of this PR being merged for the next release?

I think that the Travis issues were test system issues and not issues with these changes. But I'm not sure how to restart the tests.

wifisher avatar Mar 01 '21 22:03 wifisher

But I'm not sure how to restart the tests.

I'll restart the tests.

breautek avatar Mar 01 '21 22:03 breautek

It looks like the recently run tests completed successfully. It would be nice to have it merged in.

wifisher avatar Mar 04 '21 21:03 wifisher

closing since windows platform has been removed

jcesarmobile avatar Aug 31 '23 22:08 jcesarmobile