Camera exif data are always undefined


#1

Hi all, I have see this code:

var options = {
                quality: 100,
                targetWidth: 320,
                targetHeight: 320,
                saveToPhotoAlbum: true,
                destinationType: Camera.DestinationType.FILE_URI,
                EncodingType: navigator.camera.EncodingType.JPEG,
                sourceType: Camera.PictureSourceType.PHOTOLIBRARY
            };
    navigator.camera.getPicture(
                    function(imageURI) {
                        window.resolveLocalFileSystemURL(imageURI,
                            function(entry) {
                                entry.file(function(file) {
                                    EXIF.getData(file, function() {
                                        var datetime = EXIF.getTag(this, "DateTimeOriginal");
                                        alert(datetime);
                                    });
    
                                    // do something useful....
    
                                }, function (e) {
                                    sharedService.log("resolveLocalFileSystemURL -> entry.file -> error",e);
                                });
                            },
                            function(e) {
                                alert('Unexpected error obtaining image file.');
                                sharedService.log("resolveLocalFileSystemURL -> error",e);
                            });
                    },
                    function() {
                        // nada - cancelled
                    },
                    options);

For EXIF I use EXIF-js.js library.

Why datetime is always “undefined” ?
I have change Camera.PictureSourceType.PHOTOLIBRARY to Camera.PictureSourceType.CAMERA but with the same result.

I know that all my test images have EXIF data because if I open them with an EXIF extractor I can see all EXIF data.

Thanks.

M.


#2

Hi ziobudda,

Did you got any solution to your problem…If you got, can you please post it.

At present I’m looking to extract the date and lattitude,longitude from the image.

Can you please refer any solution.

Thankyou

My question - How to get the EXIF data(date & Location) of the Image?