gstreetmedia / Titanium-Mobile-ExifData

A straight up Javascript Class for reading EXIF data from either a filepath or a Blob
44 stars 9 forks source link

Offset error #4

Open gjmcginn opened 10 years ago

gjmcginn commented 10 years ago

I get the following error when trying to read the exif data from files in the gallery:

[INFO] :   EXIF::FileReader filePathOrBlob is string
[INFO] :   Not a valid marker at offset 623, found: 249
[INFO] :   EXIF::FileReader filePathOrBlob is blob
[INFO] :   Not a valid marker at offset 623, found: 249

Here's my code

    Titanium.Media.openPhotoGallery({
        mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO],

        success:function(event) {
            var image = event.media;
            alert('image url: ' + image.nativePath);

            var Exif = require("Exif");

            var dataPath = Exif.fromPath(image.nativePath);
            var dataBlob = Exif.fromBlob(image);

            Ti.API.info (Exif.pretty(dataPath));
            Ti.API.info (Exif.pretty(dataBlob));

            console.log(Exif.pretty(Exif.fromPath(image.nativePath)));
            console.log(Exif.pretty(Exif.fromBlob(image)));                         
        }
    });

Titanium Studio 3.4 Titanium SDK 3.4.0 Android 4.2.2 emulator

jjmaceda commented 9 years ago

I think the problem is the emulator, I had the same errors, but when I try the real device works as expected