[TIMOB-13655] Android: Photo with camera overlay not uploading to ACS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-04-29T23:13:46.000+0000 |
Affected Version/s | Release 3.0.0, Release 3.1.0 |
Fix Version/s | 2013 Sprint 09 API, 2013 Sprint 09 |
Components | Android |
Labels | ipass1, regression, triage |
Reporter | Freddy Montano |
Assignee | Ping Wang |
Created | 2013-04-15T17:18:25.000+0000 |
Updated | 2017-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
File | Date | Size |
---|---|---|
app.js | 2013-04-15T17:18:25.000+0000 | 3566 |
cameraOverlayFailure300GA | 2013-04-23T18:27:04.000+0000 | 19243 |
cameraOverlayFailure310GA | 2013-04-23T18:27:04.000+0000 | 22783 |
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.
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.
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.
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.
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?
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}
Closing