Piwigo Bugtracker

Piwigo bug tracker has moved to Github

This bugtracker is kept to provide history on old issues.


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003213Piwigometadatapublic2015.03.19 18:192015.03.20 13:41
Reporterxbgmsharp 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version2.7.4 
Target VersionFixed in Version 
Summary0003213: Convert IPTC location data to GPS
DescriptionFrom http://piwigo.org/forum/viewtopic.php?pid=158156#p158156 [^]

Hello!
Unfortunately most of my photos haven't had GPS coordinates because they was scaned or made photo by camera without GPS.

I have marked IPTC position/city/state/country for them and it will be good idea!

I have a few thinks about how it will be good to work:
* Many places may be out of cities, but may contain searchable names (for example "Sognefjorden" is the fjord in Norway. I can search it by Google maps (https://www.google.com/maps/place/Sogne [^] … b81323cb38), but cann't search it by http://stevemorse.org/jcal/latlon.php [^] because I nave to type city in this service)
* It will be good if OpenStreetMap read ("city" OR/and "state") and "country" OR "position" (free text, like "Sognefjorden") if "city" is empty (for example)
* If it worked with not only English (like Google Maps) it would be great!

In attachment photo with filled IPTC fields Country = "Norway" and Position "Norway, Sognefjorden"
http://media.aronov.su/tools/metadata.php [^] show for it file:
2#005 = Ñîãíå-ôüîðä
2#025 = Sognefjorden,Íîðâåãèÿ,Ñîãíå-ôüîðä
2#080 = Leonid Aronov
2#092 = Norway, Sognefjorden
2#101 = Norway
2#116 = Leonid Aronov
TagsNo tags attached.
browserany
Database engine and version
PHP version
Web serverApache 2.x
Attached Filesjpg file icon IPTC_test.jpg [^] (88,285 bytes) 2015.03.19 18:19


? file icon functions_metadata.inc.php [^] (9,392 bytes) 2015.03.19 18:50
? file icon functions_metadata.inc.php.1426854766 [^] (9,990 bytes) 2015.03.20 13:34

- Relationships

-  Notes
(0007788)
xbgmsharp (reporter)
2015.03.19 18:20

A working PoC.

Install curl module for PHP
Code:
# apt-get install php5-curl

Add in you configuration the following parameters:
Code:
$conf['show_iptc'] = true;
$conf['use_iptc'] = true;
$conf['iptc_to_gps'] = true;
$conf['show_iptc_mapping'] = array(
  'iptc_keywords' => '2#025',
  'iptc_caption_writer' => '2#122',
  'iptc_byline_title' => '2#085',
  'iptc_caption' => '2#120',
  'iptc_country' => '2#101',
  'iptc_countrycode' => '2#100',
  'iptc_state' => '2#095',
  'iptc_sublocation' => '2#092',
  'iptc_city' => '2#090',
  );

Replace the file /include/functions_metadata.inc.php by the one attach.

When you sync metadata, it will populate the latitude and longitude with the data from http://nominatim.openstreetmap.org [^] if any.
(0007789)
xbgmsharp (reporter)
2015.03.19 18:49
edited on: 2015.03.20 13:41

The code does the following:

* Check for $conf['iptc_to_gps'] to be true.
* Check for any of the location IPTC metadata are present
* If any run a CURL query to nominatim.openstreetmap.org
* If any reply, check for lat and lon.
* If any valid lat and lon return it an array to be sync in the database.


- Issue History
Date Modified Username Field Change
2015.03.19 18:19 xbgmsharp New Issue
2015.03.19 18:19 xbgmsharp File Added: IPTC_test.jpg
2015.03.19 18:20 xbgmsharp Note Added: 0007788
2015.03.19 18:49 xbgmsharp Note Added: 0007789
2015.03.19 18:50 xbgmsharp File Added: functions_metadata.inc.php
2015.03.19 18:50 xbgmsharp Note Edited: 0007789 View Revisions
2015.03.20 13:34 xbgmsharp File Added: functions_metadata.inc.php.1426854766
2015.03.20 13:41 xbgmsharp Note Edited: 0007789 View Revisions


Copyright © 2000 - 2017 MantisBT Team
Contact
Powered by Mantis Bugtracker