Exif/exiv2

Aus SchnallIchNet
Wechseln zu: Navigation, Suche

the exiv2 tool can be used to manipulate image meta-data
like exif-tags and so on...

i used it to tag geo-location into images after images created
without geo-tags, since i DO NOT WANT geotags in all of my images...

1st of all i looked up the correct values for my object.
going to google-maps or openstreetmap.org. both are ok...
in my case i used maps, going to 'Deutsches Eck in Koblenz, Germany'
zooming in and rightclick the statue and select 'Whats here?' or 'Was ist hier?'
that will create a green arrow at reghtclick-point and put the coordinates into
the searchfield: 50.364134,7.605638 (Latitude,Longitude).

to use that data in exif-tags you will have to convert it to »DEG° MIN' SEC''« 
i used this converter to do this.

Latitude:  50.364134  --> 50° 21' 50''
Longitude: 7.605638   -->  7° 36' 20''

this is used to feed exiv2.
simplest way is to put exiv2-commands into a file:

set    Exif.Image.Copyright          (c) Christoph Steidl
set    Exif.Photo.UserComment        webmaster@schnallich.net
set    Exif.GPSInfo.GPSLatitude      50/1 21/1 50/1
set    Exif.GPSInfo.GPSLatitudeRef   N
set    Exif.GPSInfo.GPSLongitude     7/1 36/1 20/1
set    Exif.GPSInfo.GPSLongitudeRef  E

since exiv2 expects 'rational number' for DEG, MIN and SEC we devide all these values by 1 (e.g. 50/1 ... a.s.o.)
in case of germany, we are north of the equator, so GPSLatitudeRef is N for north and
east of 'greenwich meridian', so GPSLongitudeRef is E for east.

finally run 'exiv2' the following way to put exiv-data into file(s):

exiv2 -m ./exiv2-data.txt /path/to/image.jpg

sadly exiv2 can only handle ONE file. so if you want to tag a whole directory-content:

for i in *.jpg; do exiv2 -m ./exiv2-data.txt $i; done


here is an example without using a file:

exiv2 -M"set Exif.GPSInfo.GPSLatitude 4/1 15/1 33/1" \
      -M"set Exif.GPSInfo.GPSLatitudeRef N" \
      -M"..." image.jpg