Trying to get Geolcation data from image

You must Login before you can answer or comment on any questions.

I want to get the EXIF data from an image after it's taken with the camera (or picked from the PhotoGallery) but it seems to strip out the EXIF data, even if the image in the photoGallery already has geo data on it. Here is the function I'm using to pick either the camera or the gallery and how I'm getting the image.

dialog.addEventListener("click", function(e) {  
        if (e.index == 0) {
            Ti.Media.showCamera({
                success : function(event) { 
                    var new_photo = event.media;
                    Ti.Media.saveToPhotoGallery(new_photo);
                    ImageUploadViewInit(new_photo); 
                },
                cancel : function() {
                    Ti.API.info('camera cancelled');
                },
                error : function(error) {
                    // set up an alert message
                    var error_msg = Titanium.UI.createAlertDialog({
                        title : 'OH NO!'
                    });
 
                    if (error.code == Titanium.Media.NO_CAMERA) {
                        error_msg.setMessage('Your device does not have a camera!');
                    } else {
                        error_msg.setMessage('Unexpected error: ' + error.code);
                    }
                    error_msg.show();
                },
                // set to allow pinch zoom square photo edit option or not
                allowEditing : true,
                // force still photos only
                mediaTypes : Titanium.Media.MEDIA_TYPE_PHOTO
            });
 
        }else if (e.index == 1) {
            Ti.Media.openPhotoGallery({
                success:function(event) {   
                    var new_photo = event.media;
                    ImageUploadViewInit(new_photo); 
                }
            });
        }
    });

1 Answer

Hi Adam,

EXIF data of an Image are still exposed through Titanium.
We have a feature request logged and it's in our roadmap, but still without a schedule: http://jira.appcelerator.org/browse/TIMOB-10567

You can put a watch on the Ticket for updates.

Thanks

Your Answer

Think you can help? Login to answer this question!