Announcement

#16 2016-09-16 19:51:35

pewe
Member
2012-03-16
439

Re: EXIF GPS data not read

Thanks - so this now begs the question - why can 2 scripts I have on my site outside of Piwigo read the data, but Piwigo won't.

Your assistance confirms that Piwigo works in PHP 7.0.10, but it definitely does not work with a lot of older PHP versions - BUT -  other scripts do.
This leads me to conclude there is possibly a bug in Piwigo which makes it not compatable with those versions.

Seems the Piwigo Team is very depleated now, so don't hold out much hope of any fixes in the foreseeable future so I have asked my host to let me know if they are going to update to PHP 7.0.10 - but I don't hold out much hope there either.

=====

So you liked Aberdeen.
I was born and lived there until 1959,then spent school holidays visiting relatives every summer for 4 weeks until 1968. Then the oil came and ruined a lot of the old town, not to mention all the other influences the oil had.

I went back there earlier this month for the first time in over 30 years and was horrified at the changes.

Other places along Deeside, (like Braemar, Ballater, Aboyne) and parts of Moray near Inverness (like Lossiemouth and Macduff ) were like they were in a time warp though - so many happy memories.

We are going back to the area for Xmas - just for a few days when we'll stay in Inverness - looking forward to Xmas lunch in the Town and we're hoping there may be some snow - just a light covering for atmosphere.

Offline

 

#17 2016-09-16 21:53:44

wittypluck
Member
2016-09-05
24

Re: EXIF GPS data not read

For the GPS bug, it is strange because the issue I had seems to be caused by a very recent change (July 2016) and only affected PHP 7.0.8, 5.6.24 and 5.5.37 I think.
Definitely something else in your case then.

Aberdeen, well, nice to have a different perspective on the changes in the last decades. I couldn't compare obviously, but the people were really welcoming. First time in Scotland so I mostly saw the tourist things, castles (Braemar!), games (Aboyne!) - and the sceneries were great.
I posted a few pictures, which brings us back to this thread as they have.. GPS location!

Last edited by wittypluck (2016-10-01 20:35:41)

Offline

 

#18 2016-09-17 00:07:01

pewe
Member
2012-03-16
439

Re: EXIF GPS data not read

Yup - I'm completely stumped - particularly as other scripts on the server work - just not Piwigo gps extraction.

I heard back from my server host who say they will be updating to PHP 7.0.10 - but don't know when!!!!

So not sure where to go from here ;(

=====

Yes - Aberdeen folk (and the Scots in general) are very friendly (but I would say that wouldn't I).

I see you went to Dunnottar - a favourite haunt of my brothers and I (along with the Stonehaven open air heated pool) back in the 50's when there were no guard rails, gates, steps etc and we could run and play wild all over the castle and grounds.

I see you also visited Duthie Park - we spent many happy afternoons there sailing very primitive boats on the boating pond - and all the relatives that we left behind when we left Aberdeen are buried in Allenvale cemetery across the road from the park.

Offline

 

#19 2016-09-17 07:57:45

eliz82
Member
Romania
2016-04-27
281

Re: EXIF GPS data not read

wittypluck wrote:

For the GPS bug, it is strange because the issue I had seems to be caused by a very recent change (July 2016) and only affected PHP 7.0.8, 5.6.24 and 5.5.37 I think.

No, is not. This is a very old bug in PHP. As you can see in the thread posted here from exiftool forum is dated from 2012.
I have PHP 5.6.19 on my server and the bug is there.

But this bug is hard to catch:
1) they are not many software gallery that use internal PHP functions to read exif. majority use libraries created specialy for reading exif witch do not use PHP exif module.
2) they are small chances to have a picture with makernotes into it. people didn't used to put fullsize pictures (out of camera) to the web galleries. i never seen image edit software that do not strip makernotes from exif when resize for web (ex. Adobe Photoshop, Irfanview). because of course when you have a picture 100-200kB in size you don't want to keep an exif section that have 20kB of data.

Last edited by eliz82 (2016-09-17 08:00:36)

Offline

 

#20 2016-09-17 16:30:14

pewe
Member
2012-03-16
439

Re: EXIF GPS data not read

wittypluck wrote:

But this bug is hard to catch:

2) they are small chances to have a picture with makernotes into it. people didn't used to put fullsize pictures (out of camera) to the web galleries. i never seen image edit software that do not strip makernotes from exif when resize for web (ex. Adobe Photoshop, Irfanview). because of course when you have a picture 100-200kB in size you don't want to keep an exif section that have 20kB of data.

But this still does not explain why 2 scripts I have on my site, as well as a plugin called 'Read Metadata' by ddtddt, do read the exif data.

I am no coder and certainly no expert in PHP, but I did manage to create 3 php scripts to extract exif data from sources on the internet and the results were as follows.

Script 1 (gps1.php):

"<?php
$filename = 'picture.jpg';
$data = exif_read_data($filename, NULL, 1);
if(isset($data['GPS'])) {
     print_r($data['GPS']);
} else {
     echo 'No GPS data available.';
}
?>"

This script works and displays the GPS data only as that is all that it is scripted for.

Script 2 (gps2.php):

"<?php
$exif = exif_read_data('picture.jpg');
  print_r($exif);
?>"

This works and displays all the exif data including the MakerNotes - albeit that the MakerNotes are garbled.

This is script 3 (gps3.php):
"<?php
$image = "picture.jpg";
$exif = exif_read_data($image, 0, true);
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
echo "$key.$name: $val\n";
}
}
?>"

This also works to display exif data including garbled MakerNotes - BUT does not display the GPS data.

As I have said, I am no expert and do not understand the differences in the scripts to determine why 2 of them consistently return GPS data and one does not.

Maybe someone with PHP skills can understand and explain it.

The scripts are all located at  - http://pewe.uk/gpstest - followed by the individual script name.
The photo is also at the same location and is called (no surprise hear) - picture.jpg

Last edited by pewe (2016-09-17 16:31:27)

Offline

 

#21 2016-09-18 14:11:25

wittypluck
Member
2016-09-05
24

Re: EXIF GPS data not read

By the way do you have use_exif and/or show_exif enabled in your Piwigo conf ?

Offline

 

#22 2016-09-18 17:05:44

pewe
Member
2012-03-16
439

Re: EXIF GPS data not read

Hi WP

Yes the exif is turned on in the config.

Offline

 

#23 2016-09-18 23:55:58

pewe
Member
2012-03-16
439

Re: EXIF GPS data not read

Ok - I have fixed the problem - here's how.

I first checked the config file using ftp to check for exif settings and the only one in the file is the 'show_exif' entry which as I have already said, was set to 'true'

I then activated the plugin 'Local files editor' which I had not done since installation.

Then I went to the 'Local files editor' in the Plugin section of admin and it opened with one entry showing - which must have been in the install package - as follows

<?php $conf["show_exif"] = $conf["use_exif"] = false;

I changed this to
<?php $conf["show_exif"] = $conf["use_exif"] = true;

and now the gps extraction and sync works as expected.

Very strange because when I last used Piwigo a few years ago activation of the Local files editor did not display any content at all.

Anyway - the problem appears to be solved so thanks for the input guys.

Offline

 

#24 2016-09-19 22:16:02

wittypluck
Member
2016-09-05
24

Re: EXIF GPS data not read

Good news!

Offline

 

#25 2016-09-23 16:02:58

erAck
Only trying to help
2015-09-06
2020

Re: EXIF GPS data not read

pewe wrote:

Then I went to the 'Local files editor' in the Plugin section of admin and it opened with one entry showing - which must have been in the install package

IIRC Piwigo does not come with any content in local/config/config.inc.php or even that file being present. Whatever added

<?php $conf["show_exif"] = $conf["use_exif"] = false;

to your local config was something else but not the Piwigo installation. (Unless there was some automatic detection that exif extraction was not supported by your PHP, which I don't know if such thing would be recorded in the local config). Having everything on one line also doesn't look like Piwigo style.


Running Piwigo at https://erack.net/gallery/

Offline

 

#26 2016-09-23 19:51:20

pewe
Member
2012-03-16
439

Re: EXIF GPS data not read

I just had a look in the distribution content which I downloaded, and as you say the config.inc.php file is not there.

I then remembered that when I first uploaded the package I had problems with weird issues arising (such as the web upload not uploading files fully etc). so I used the auto installer on the Control panel on the host server to install piwigo again.

So, for whatever reason, the host installation must have included the content - as I had not activated the Local File Editor prior to the occasion when I did and noticed the modified content.

Anyway, the content has been corrected and now it all works, it was just unfortunate that this mod had been done as it made it quite a frustrating and time consuming job to get to a resolution.

Offline

 

#27 2016-11-03 18:52:17

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: EXIF GPS data not read

Hi everybody,

This problem seems to occur to many people. I thought it was a bug in PHP, but it seems there might be a bug in Piwigo too. "Unfortunately" I don't reproduce the bug on my environment, so it's complicated to fix the bug.

@eliz82 : using an external EXIF parser could be in the roadmap, see [Forum, topic 25997] Issues in Exif parsing, but I would prefer to fix this issue if possible without this kind of important change.

On one side, some of you seem to say:

if you remove makernotes in EXIF metadata, PHP can read GPS metadata and Piwigo can register latitude/longitude

... on the other side, pewe seems to say the problem is still there once makernotes metadata field is removed and that other PHP piece of code can see GPS metadata but not Piwigo.

@pewe, can you activate [extension by ddtddt] Read Metadata, edit the photo and click on the "read metadata" link and tell us if you see some GPS* fields?

Offline

 

#28 2016-11-22 21:54:44

fibule
Guest

Re: EXIF GPS data not read

About this pfoblem, i post a reply in the french forum

http://fr.piwigo.org/forum/viewtopic.ph … 22#p219622

Sorry, but my english is not very clean

Bye

 

#29 2016-11-26 12:31:12

oz1cz
Member
2016-11-26
4

Re: EXIF GPS data not read

fibule wrote:

About this pfoblem, i post a reply in the french forum

http://fr.piwigo.org/forum/viewtopic.ph … 22#p219622

In that post you suggest that people remove Exif.Image.Make, but I think you want to remove Exif.Photo.MakerNote.

Last edited by oz1cz (2016-11-26 12:31:40)

Offline

 

#30 2016-11-29 13:14:33

volare
Member
Bavaria
2016-11-13
22

Re: EXIF GPS data not read

I have the same problem , reported already in the extension section , but no response .
Here is now many information above , but I don`t really understand/know what I have to do to get rid of the problem.

best regards

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact