View exif data

exif_read_data not returning any GPS data - View exif data

exif_read_data not returning any GPS data

by xiaolu » Thu Mar 09, 2017 12:01 pm

Installed this extension on a friend's board, and followed the installation instruction to the letter. Everything works fine, except with ALL uploaded images that do have GPS data embedded in EXIF (all such photos showed correct GPS data when viewed with some other photo viewing software), it always show "GPS data not available"

I did some "debug" on @exif_read_data($filename, "EXIF, IFD0, GPS", true)

And I see this below if statement is always FALSE on uploaded photos with GPS data:

if (!empty($exif["EXIF"]) || !empty($exif["GPS"]) || !empty($exif["IFD0"]))

But other part of EXIF data (such as image orientation, etc) show up just fine such as with this if statement:

if (!empty($exif['Orientation'])

I start to wonder if in my case, function exif_read_data with "PHP Version 5.2.17" (in my case) does not support extracting GPS data from EXIF, or what?

Any insight? Thanks!
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact:

Re: exif_read_data not returning any GPS data

by canonknipser » Thu Mar 09, 2017 12:25 pm

Hi,
According to the specifications of exif_read_data, nothing was changed since PHP 4.3.0. The function follows strictly the exif 2.2-Standard, but many camera manufacturer don't write their tags correctly. Other image interpreters are (maybe) more error-tolerant in handling metadata.
Would it be possible to upload one of the problematic images in my testing area so I can further investigate this issue? You'll find it here: http://canonknipser.com/viewforum.php?f=11

Thanks in advance
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: exif_read_data not returning any GPS data

by xiaolu » Thu Mar 09, 2017 1:11 pm

Thank you for your very quick reply. I just visited your site http://canonknipser.com/viewforum.php?f=11

Registered (Username: xiaolu)
Activated via --> email --> click link
Logged in
Viewed topic: "viewexif extension" (trying to reply to this topic, and upload an sample image with GPS data)

But I do not have permission to post at all.

Thanks again
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact:

Re: exif_read_data not returning any GPS data

by xiaolu » Thu Mar 09, 2017 1:14 pm

Ok, I followed http://canonknipser.com/viewforum.php?f=11, and created a new topic, and attached a sample image. (though I can't view my post yet)
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact:

Re: exif_read_data not returning any GPS data

by canonknipser » Thu Mar 09, 2017 1:16 pm

Just recognized you found the correct area and approved your post, but you posted one of my test images, not one of yours ;)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: exif_read_data not returning any GPS data

by xiaolu » Thu Mar 09, 2017 1:26 pm

Yes, but even with that image from you, I have the same problem (does not find GPS data with exif_read_data).

And then just now I posted a new one

Thanks again
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact:

Re: exif_read_data not returning any GPS data

by canonknipser » Thu Mar 09, 2017 1:39 pm

No image attached to the new post. But when even my photo (which you can clearly see has a google maps link with the gps position) doesn't work on your site, there must be a problem with your PHP libraries. Can you give me informations about your exif version (see phpinfo module in acp)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: exif_read_data not returning any GPS data

by xiaolu » Thu Mar 09, 2017 1:44 pm

I updated the post, and re-attached an image (taken with my iphone6).

And then from board ACP --> PHP information: PHP Version 5.2.17

Thanks again!

But yes, on your test site, I do see the image from you that I posted did show up with GPS data! (on google map on clicked:-)
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact:

Re: exif_read_data not returning any GPS data

by canonknipser » Thu Mar 09, 2017 2:01 pm

xiaolu wrote: ACP --> PHP information: PHP Version 5.2.17
a little further down, you should see the exif library informations like those:
screen37.jpg
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: exif_read_data not returning any GPS data

by xiaolu » Thu Mar 09, 2017 2:02 pm

forgot to add exif-specific info:

from ACP --> PHP Info:

'--enable-exif'

exif
EXIF Support enabled
EXIF Version 1.4 $Id: exif.c 293036 2010-01-03 09:23:27Z sebastian $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact:

Re: exif_read_data not returning any GPS data

by canonknipser » Thu Mar 09, 2017 2:20 pm

just had a little investigation and found this: https://bugs.php.net/bug.php?id=73004 which seems to be the same problem as yours, but it is said for PHP version >= 5.6.25 ...
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: exif_read_data not returning any GPS data

by xiaolu » Thu Mar 09, 2017 2:38 pm

Thank you again for all the help and for the info you provided. So more than likely (and I am convinced) it (the issue) is with the php package (its version of exif "library" or function). I will see if there is anything I can "play" with. Thank you again for all the help!

PS: You can remove the pic I uploaded on your test site (the one I took at home with GPS coordinate:-)

Thanks again,
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact:

Re: exif_read_data not returning any GPS data

by canonknipser » Thu Mar 09, 2017 4:58 pm

Thank you for pointing me to a potential issue with the PHP libraries - good to know for future support :!:

I removed your photo so your home is hidden again ;)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: exif_read_data not returning any GPS data

by canonknipser » Thu Mar 09, 2017 6:45 pm

Just another hint: maybe it's worth to upgrade the PHP version, because 5.2 has reached EOL more than 6 years ago (and maybe has some security leaks) and the actual 5.6-Version is good if you plan to update your phpBB to 3.2.x.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: exif_read_data not returning any GPS data

by xiaolu » Fri Mar 10, 2017 11:51 am

canonknipser wrote:Just another hint: maybe it's worth to upgrade the PHP version, because 5.2 has reached EOL more than 6 years ago (and maybe has some security leaks) and the actual 5.6-Version is good if you plan to update your phpBB to 3.2.x.
Thanks. I was indeed thinking to upgrade php but with webhosting --> cpanel I didn't find the option to upgrade, so I think I need to contact the hosting company.... Cheers
xiaolu
Registered User
Posts: 283
Joined: Sun Sep 29, 2013 7:37 pm
Contact: