Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9580] Android: Images captured using Ti.Media.showCamera() are written to SD card on Android

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-25T16:03:13.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sSprint 2012-13 API, Release 3.0.0
ComponentsAndroid
LabelsSupportTeam, api
ReporterVarun Joshi
AssigneeJosh Roesslein
Created2012-06-15T14:24:00.000+0000
Updated2013-04-11T22:03:16.000+0000

Description

Problem

Captured images are written to the Android device's SD card at /DCIM/Camera/. (even with saveToPhotoGallery option as false)

From the customer:

This is a potential security issue for us because we are capturing images of checks, which contain bank account numbers. We need a way to disable this behavior. For our purposes it is not sufficient to delete the image after writing it to the file system. Forensics tools can still recover the data from the file system even if the file is deleted. The image can never be written to storage at all. Here is a sample app.js that reproduces the problem: {noformat} Titanium.Media.showCamera({ success:function(event) { alert('Success - now check SD card for captured image'); }, cancel:function() { alert('cancelled'); }, error:function(error) { alert(error); }, saveToPhotoGallery:false, mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO] }); {noformat}

Comments

  1. Vinothbabu 2012-06-22

    Will this issue get fixed in the July 1st release.
  2. Josh Roesslein 2012-06-26

    Created [PR #2475](https://github.com/appcelerator/titanium_mobile/pull/2475) to resolve issue.
  3. Hieu Pham 2012-06-29

    Expected behavior for testing with KS Camera Tests: Non HTC Phones: 1. Basic Camera: the image should be stored in sdcard/Pictures folder 2. Camera custom overlay: no image should be store in sdcard (check sdcard/dcim/Camera/KitchenSink and sdcard/Pictures) 3. Camera overlay webview: no image should be store in sdcard (check same locations as #2) 4. SaveToGallery: the image should be stored in sdcard/Pictures folder 5. SaveToFile: the image should be stored in sdcard/dcim/Camera/KitchenSink AND when you exit the app, it should be DELETED. If you're testing with HTC phones, all images stored in sdcard/Pictures will be stored in sdcard/dcim/100media instead.
  4. Carter Lathrop 2012-07-25

    I have tried using the kitchen sink example code to apply this fix, since it sounds like the only way to never save an image to the external SD is if you use a custom overlay on the camera. So when using the kitchen sink code, even if saveToPhotoGallery is not declared, no image is saved at all (on sd or internally). Here is the code that shows this: http://pastie.org/4332655 Running on Rezound Android 4.0. Any guidance on this fix or how to only save an image to internal storage (without ever saving anything to external) with a code example would be extremely helpful since a customer needs this functionality asap.
  5. Carter Lathrop 2012-07-25

    I found the error, this commment: If you're testing with HTC phones, all images stored in sdcard/Pictures will be stored in sdcard/dcim/100media instead is incorrect. htc phones will store in sdcard/pictures, not in dcim. closing ticket again.

JSON Source