Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13655] Android: Photo with camera overlay not uploading to ACS

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2013-04-29T23:13:46.000+0000
Affected Version/sRelease 3.0.0, Release 3.1.0
Fix Version/s2013 Sprint 09 API, 2013 Sprint 09
ComponentsAndroid
Labelsipass1, regression, triage
ReporterFreddy Montano
AssigneePing Wang
Created2013-04-15T17:18:25.000+0000
Updated2017-03-28T20:32:01.000+0000

Description

When you use an overlay to take a picture using Ti.Media.showCamera, the resulting photo can't be upload to ACS. This is the debug message I get: http://pastebin.com/3ENbdsW9. It works if you use 2.1.4 To replicate, just create a new Titanium project (no alloy) with ACS enabled, and then replace app.js with the attached app.js. Open the app, and click on the button Take Photo With Overlay. If you build the app using SDK 2.1.4 it works just fine. If you build with any SDK > 3.0 you get an error and a debug message like the one above.

Attachments

FileDateSize
app.js2013-04-15T17:18:25.000+00003566
cameraOverlayFailure300GA2013-04-23T18:27:04.000+000019243
cameraOverlayFailure310GA2013-04-23T18:27:04.000+000022783

Comments

  1. Eric Merriman 2013-04-23

    Mukesh investigated this from the ACS side, and it seems ok there (fails, but not ACS), but the image is empty. I will look now at the SDK side to see if the image is not formed correctly.
  2. Eric Merriman 2013-04-23

    Verified failure with 3.0.0.GA and 3.1.0.GA. Does not occur on 2.1.4 GA, does not occur on iOS. While clicking the "take photo (no overlay)" works as expected, "with overlay" fails when clicked. Attaching logs for both SDKs.
  3. Ping Wang 2013-04-25

    Hi Eric, can you add "saveToPhotoGallery: true" to the options which is used to showCamera()? A big change ([PR#2475| https://github.com/appcelerator/titanium_mobile/pull/2475]) in camera from 2.1.4 to 3.0 is we don't write the photo to the SD card any more if using overlay camera and setting saveToPhotoGalley to false.
  4. Ping Wang 2013-04-29

    Just tested the attached the test case "with overlay". It fails no matter setting saveToPhotoGallery to true or false. This is because the e.media in the callback of showCamera() is a non-file blob type on 3.0 or above while it is a file blob type before 3.0. Based on the [Cloud doc](http://docs.appcelerator.com/cloud/latest/#!/api/Photos-method-create), the "photo" parameter in the cloud.Photos.create() method should be a file not a blob. Don't think the attached test case is a valid test. Resolve the ticket as Invalid.
  5. Aaron K. Saunders 2013-05-02

    We were told this was an issue and would be fixed, now this issues is closed as not a bug with no explanation or workaround To me it is pretty simple, code worked in previous releaseā€¦ stopped working in new release. Either it is a bug OR the documentation should be provided to tell us the correct implementation, but to just close the bug when we have been waiting for a solution is completely unacceptable from a support perspective IMHO. Can we at least have a more appropriate response?
  6. Ping Wang 2013-05-02

    There used to have a security issue on the Titanium Android Camera, which is described in TIMOB-9580. We fixed that on 3.0.0 and the fix required the change of the blob type that is returned from the camera. A workaround for the attached app is to write the blob to a file and then use the file as the parameter to call cloud.Photos.create(). BTW, from our [doc](http://docs.appcelerator.com/cloud/latest/#!/api/Photos-method-create), the parameter "photo" has to be a binary file. {quote} photo : FileUpload REQUIRED The attached binary file. {quote}
  7. Eric Merriman 2017-03-28

    Closing

JSON Source