[TIMOB-1652] Android: showCamera()'s success callback does not work for HTC phones
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:56:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, camera, defect |
Reporter | Ryan Coyner |
Assignee | Don Thorp |
Created | 2011-04-15T02:58:28.000+0000 |
Updated | 2011-04-17T01:56:46.000+0000 |
Description
The success callback is supposed to have the cropRect and media properties... The media property however is always returned as undefined, and the cropRect property only returns the default values. The image itself is successfully saved in the DCIM/Camera directory, but there is no way to access the image in that callback function.
Tested on HTC Droid Eris 2.1 and HTC Evo 2.2. I'm not sure if this is an issue for all Android phones or not.
I haven't encountered this with my Nexus 1; this is also an HTC phone but running a more stock 2.2 operating system. Could be some problem related to the Sense tweaks... perhaps the photo file's saving to a different place?
HTC interpreted the Intent differently that Google.
All photos are saved into "/sdcard/dcim/Camera", as defined by PHOTO_DCIM_CAMERA in MediaModule.java. When saveToPhotoGallery is enabled, it just dumps the image in that directory. When it is disabled (which it is by default), it creates a new set of directories in "/sdcard/dcim/Camera" which reflects the package name of your app (com/foo/bar).
The images being saved there isn't so much of an issue, although it would be nice to be able to properly define where it can be saved. The problem is that the success callback doesn't properly grab the information about the image. Accessing event.media returns undefined.
(from [beec48069f8749b354a46ac66edf757a0bbd657e]) [#1652 state:fixed-in-qa] Added support for detecting the HTC camera app and working with it's different requirement for capturing images. If saveToPhotoGallery is true, the image is left where the camera puts it. If false, then the file is moved to the applications photo directory and the content provider updated with that information. This matches more closely with what we do when using the Google camera app. http://github.com/appcelerator/titanium_mobile/commit/beec48069f8749b354a46ac66edf757a0bbd657e"> http://github.com/appcelerator/titanium_mobile/commit/beec48069f874...
verified on an htc eris