PDA

View Full Version : exif_read_data problem after working with BB Pro 1.92



cppcodeguru
February 20th, 2009, 12:50 PM
Hello,

I get the following warnings from the php function exif_read_data after working with BB Pro 1.92. I used the new feature to add gps coordinates to a DNG file, then I resized it to 400x400 size and saved it as jpg. I uploaded it to panoramio and all seemed to be fine, the correct position was displayed. But after uploading the picture to my homepage gallery, I got the following exif_read_data warnings from my php script command ... $exif = exif_read_data($fp, 0, true) ...:

Warning: exif_read_data(20090204_212856_G9_01_1171_1.jpg) [function.exif-read-data]: incorrect APP1 Exif Identifier Code

Warning: exif_read_data(20090204_212856_G9_01_1171_1.jpg) [exif_read_data]: illegal IFD size: x0003 + 2 + x2A49*12 = x1FB6F > x209C

Warning: exif_read_data(20090204_212856_G9_01_1171_1.jpg) [exif_read_data]: process tag(x0000=UndefinedTa): Illegal pointer offset(x60002 + x10F0000 = x1150002 > x209C)

Can anyone help?

Chris Breeze
February 20th, 2009, 01:32 PM
It might be a problem with the PHP EXIF libraries. Is the EXIF and GPS data readable in other apps e.g. BreezeBrowser Pro, Photoshop, Picassa, ExifTool etc.?

cppcodeguru
February 20th, 2009, 01:45 PM
In BB Pro, the exif is visible in the shooting data tab.
Because I want the gps for IMatch, I added a user Tab with GPS Info,
and there the Long/Lat/Alt/MapDate/VersioID is also displayed. GeoSetter can
read them too.
The only problem seems to be the php function exif_read_data.

Whishlist:
I mentioned Geosetter, this program adds also the country code, country, city, a.s.o. (you can query this on demand online or it is set automatically based on the corrdinates) Is it possible to have this feature in BB Pro too, so I don't need to use Geosetter any more (because it's not very fast with a lot of files in one dir) and can do all my work with BB.

cppcodeguru
February 20th, 2009, 01:54 PM
I put a @ in front of the exif_read_data call for the moment to ignore the warnings.
I am trying to display the Lat/Long/Alt with this command tell you later if this worked.

cppcodeguru
February 20th, 2009, 03:09 PM
Fine, after searching the net for information to get the GPS out of the jpg with php and the call exif_read_data I got the following:

$exif = @exif_read_data($fp, 'EXIF, IFD0, GPS', true);
echo $exif['GPS']['GPSAltitude'];

I could get all GPS information I put in with BB, but had to disable the warnings with the @.

The two problems that exists is the warnings and that I didn't have a thumbnail any more in the jpg after using BB. If I load the jpg into Adobe Photoshop Elements 6 and save it again and upload it to the server, the thumbnail is visible.