naturalgis / naturalgis_geotag_and_import_photos Goto Github PK
View Code? Open in Web Editor NEWA QGIS plugin to tag and geo-tag photos (and import them as point layer)
License: GNU General Public License v2.0
A QGIS plugin to tag and geo-tag photos (and import them as point layer)
License: GNU General Public License v2.0
Hi
i have images i beforehand entered "normal" tags like lat lon, but also custom tags defined through a config file. I do this process through an excel vba + exiftool-batch stuff, and exiftool reads and writes those values without any complaints as often as i like.
Those images seem to cause problems with the plugin though. Setting the input directory to a dir with such an image gives an error:
Fehler bei der Ausführung von Python-Code:
Traceback (most recent call last):
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\importphotosdialog.py", line 86, in selectPhotosDir
self.loadTags( dirName )
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\importphotosdialog.py", line 127, in loadTags
md = et.get_metadata( os.path.join( root, f ) )
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\exiftool.py", line 255, in get_metadata
return self.execute_json(filename)[0]
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\exiftool.py", line 239, in execute_json
return json.loads(self.execute(b"-j", *params).decode("utf-8"))
File "C:\OSGeo4W\apps\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf7 in position 12620: invalid start byte
Python-Version:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
QGIS-Version:
1.8.0-Lisboa Lisboa, f440b60@
Python-Pfad: ['C:/OSGeo4W/apps/qgis/./python', 'C:/Users/vogelbe/.qgis//python', 'C:/Users/vogelbe/.qgis//python/plugins', 'C:/OSGeo4W/apps/qgis/./python/plugins', 'C:\\Program Files (x86)\\ArcGIS\\bin', 'C:\\OSGeo4W\\bin\\python27.zip', 'C:\\OSGeo4W\\apps\\Python27\\DLLs', 'C:\\OSGeo4W\\apps\\Python27\\lib', 'C:\\OSGeo4W\\apps\\Python27\\lib\\plat-win', 'C:\\OSGeo4W\\apps\\Python27\\lib\\lib-tk', 'C:\\OSGeo4W\\apps\\qgis\\bin', 'C:\\OSGeo4W\\apps\\Python27', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode', 'C:\\OSGeo4W\\apps\\qgis\\python\\plugins\\fTools\\tools']
The mouse pointer is busy all the time and the dialog stays open but is the background. No attributes are shown, not even the normal exif-tags. When i in addition add the path to the .config, i get this error.
Fehler bei der Ausführung von Python-Code:
Traceback (most recent call last):
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\importphotosdialog.py", line 168, in selectConfigFile
self.loadTags( self.lePhotosPath.text() )
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\importphotosdialog.py", line 127, in loadTags
md = et.get_metadata( os.path.join( root, f ) )
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\exiftool.py", line 255, in get_metadata
return self.execute_json(filename)[0]
File "C:/Users/vogelbe/.qgis//python/plugins\geotagphotos\exiftool.py", line 239, in execute_json
return json.loads(self.execute(b"-j", *params).decode("utf-8"))
File "C:\OSGeo4W\apps\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf7 in position 12620: invalid start byte
Python-Version:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
It is possible to complete the task and create a shapefile with the proper coordinates, but the attribute list only contains filepath and filename.
After closing the dialog, the mouse pointer is still indicating busyness until i restart Qgis completely.
Config file:
# exiftool config file
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::Main' => {
ivl => {
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::ivl',
},
},
},
);
# This is a basic example of the definition for a new XMP namespace.
# This table is referenced through a SubDirectory tag definition
# in the %Image::ExifTool::UserDefined definition above.
# The namespace prefix for these tags is 'xxx', which corresponds to
# an ExifTool family 1 group name of 'XMP-xxx'.
%Image::ExifTool::UserDefined::ivl = (
%xmpTableDefaults,
GROUPS => { 0 => 'XMP', 1 => 'XMP-ivl', 2 => 'Image' },
NAMESPACE => { 'ivl' => 'http://www.communicatingastronomy.org/ivl1.0/' },
WRITABLE => 'string',
'Plotnummer' => {},#AM00200M
'Unterplot' => {},#AM00223M
'DateiNeu' =>{},#AM00200M_F1_20100911
'DateiOrig' => {},#DSC001.jpg
'DateiDatum' => {},#20100911_1614
'Fotonummer' => {},#00, 01, F1
'Text' => { Writable => 'lang-alt' },#-de deutsch oder englisch
'Datum' => {},#11.09.2011 16:15
'TextDatum' => {},#11.09.2011
'Gruppe' => {},#AM
'Label' => {},#Entweder Fotonummer oder Unterplot
'Label_X' => {},#Label X-Versatz
'Label_Y' => {}, #Label-Y-Versatz
);
#------------------------------------------------------------------------------
1; #end
When i import the image locations, the resulting point layer seems to be default WGS84.
It would be nice to be either promted to choose another CRS or have it saved in the project CRS (= respecting the settings in Options -> CRS for new layers).
With the resulting layer in WGS84, i can't use spatial functions and always have to save a reprojected version to be able to work with it, leading to more junk files within the project.
From Redmine:
"The changes that I've made are:
Links for bugtracker etc. were wrong. I fixed it on the web interface. Please fix them in the metadata also.
Thanks.
If a new shapefile output is being created but the "append" flag is checked QGIS crashes (with minidump).
Tested on QGIS 2.14/2.18 on Windows 10.
One user comments that "Open the Phyton console before you start to load the pictures. this prevents the process from hanging (i have no idea why)".
Reported errors are
Traceback (most recent call last):
File "C:/Users/flo/.qgis//python/plugins\geotagphotos\importphotosdialog.py", line 86, in selectPhotosDir
self.loadTags( dirName )
File "C:/Users/flo/.qgis//python/plugins\geotagphotos\importphotosdialog.py", line 127, in loadTags
md = et.get_metadata( os.path.join( root, f ) )
File "C:/Users/flo/.qgis//python/plugins\geotagphotos\exiftool.py", line 255, in get_metadata
return self.execute_json(filename)[0]
File "C:/Users/flo/.qgis//python/plugins\geotagphotos\exiftool.py", line 239, in execute_json
return json.loads(self.execute(b"-j", *params).decode("utf-8"))
File "C:\PROGRA~2\Quantum GIS Lisboa\apps\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf5 in position 68068: invalid start byte
and
Traceback (most recent call last):
File "D:\Documents and Settings\##########/.qgis2/python/plugins\geotagphotos\importphotosdialog.py", line 88, in selectPhotosDir
self.loadTags(dirName)
File "D:\Documents and Settings\##########/.qgis2/python/plugins\geotagphotos \importphotosdialog.py", line 125, in loadTags
with et:
File "D:\Documents and Settings\##########/.qgis2/python/plugins\geotagphotos\exiftool.py", line 179, in enter
self.start()
File "D:\Documents and Settings\##########/.qgis2/python/plugins\geotagphotos\exiftool.py", line 162, in start
stderr=devnull)
File "C:\PROGRA~1\QGISDU~1\apps\Python27\lib\subprocess.py", line 711, in init
errread, errwrite)
File "C:\PROGRA~1\QGISDU~1\apps\Python27\lib\subprocess.py", line 948, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Hi there,
i get the following error when i click OK on the "import photos" module:
2015-06-30T09:09:18 1 Fehler bei der Ausführung von Python-Code:
Traceback (most recent call last):
File "C:/Users/freiluftkonzepte/.qgis2/python/plugins\geotagphotos \importthread.py", line 117, in run
ft["filename"] = f
KeyError: 'filename'
Python-Version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS-Version:
2.10.0-Pisa Pisa, a486c7c
2023-11-20T11:50:58 CRITICAL Installazione plugin non riuscita: Error transferring https://plugins.qgis.org/plugins/geotag_and_import_photos/version/3.1.0/download/ - server replied: Not Found
thank you
stefano
An error has occured while executing Python code:
Traceback (most recent call last): File "/Users/USERNAME_HERE/.qgis2/python/plugins/geotagphotos/geotagphotos.py", line 142, in settings dlg = settingsdialog.SettingsDialog(self.iface) File "/Users/USERNAME_HERE/.qgis2/python/plugins/geotagphotos/settingsdialog.py", line 49, in init self.manageGui() File "/Users/USERNAME_HERE/.qgis2/python/plugins/geotagphotos/settingsdialog.py", line 53, in manageGui self.leConfigPath.setText(utils.getConfigPath()) TypeError: QLineEdit.setText(QString): argument 1 has unexpected type 'QPyNullVariant'
Python version: 2.7.6 (default, Sep 9 2014, 15:04:36) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
Is qgis 3 support planned?
Traceback (most recent call last):
File "/home/giovanni/.qgis2/python/plugins/geotagphotos/importphotosdialog.py", line 88, in selectPhotosDir
self.loadTags(dirName)
File "/home/giovanni/.qgis2/python/plugins/geotagphotos/importphotosdialog.py", line 125, in loadTags
with et:
File "/home/giovanni/.qgis2/python/plugins/geotagphotos/exiftool.py", line 179, in enter
self.start()
File "/home/giovanni/.qgis2/python/plugins/geotagphotos/exiftool.py", line 162, in start
stderr=devnull)
File "/usr/lib/python2.7/subprocess.py", line 679, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 20] Not a directory
another user reports
Traceback (most recent call last):
File "/home/paneves/.qgis2/python/plugins/geotagphotos/importphotosdialog.py", line 88, in selectPhotosDir
self.loadTags(dirName)
File "/home/paneves/.qgis2/python/plugins/geotagphotos/importphotosdialog.py", line 141, in loadTags
for k, v in md.iteritems():
AttributeError: 'NoneType' object has no attribute 'iteritems
but maybe is just a problem of correctly installing/configuring exiftools as after that the first type of error disappear. Anyway should be something that would be better to catch and return a better error message.
When importing, the resulting shape file's attribute fields are all string type. (Which is logical, cause as far as i know, exif informations have no other types than string).
My example: I would like to use the GPSImgDirection field as the rotation field for arrows, indicating the ... well .. image direction. As string, it doesn't work, so extra steps have to be done to get a layer to be able to work with.
There might be other numerical tags or custom tags with number content other than those GPS-Informations. Having the possibility to influence the field type for a tag would help to streamline the hole process of retrieving the needed informations from the images.
I get this error message 👍
2017-04-19T14:24:33 1 Traceback (most recent call last):
File "C:/Users/afrancois1/.qgis2/python/plugins\geotagphotos\importphotosdialog.py", line 88, in selectPhotosDir
self.loadTags(dirName)
File "C:/Users/afrancois1/.qgis2/python/plugins\geotagphotos\importphotosdialog.py", line 132, in loadTags
md = et.get_metadata(os.path.join(root, f))
File "C:/Users/afrancois1/.qgis2/python/plugins\geotagphotos\exiftool.py", line 255, in get_metadata
return self.execute_json(filename)[0]
File "C:/Users/afrancois1/.qgis2/python/plugins\geotagphotos\exiftool.py", line 239, in execute_json
return json.loads(self.execute(b"-j", *params).decode("utf-8"))
File "C:\PROGRA1\QGIS21.18\apps\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 38052-38053: invalid continuation byte
when defining the path to this photo on import window
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.