There are 0 registered members and 13 guests currently viewing the site.
A password will be e-mailed to you.
Batch Geo-Tagging Photos For The Panoramio UploaderPanoramio is a community-powered site for exploring places through photography: cities, natural wonders, or anywhere you might go. Panoramio is a showcase for the talents of its contributors, a place to see the world, and a community where members determine the content. Panoramio is different from other photo sharing sites because the photos illustrate places - Panoramio's all about seeing the world. I decided to share some of my travel photographs on Panoramio. To do this, the photos need a title and a lattitude/longitude position. When uploading, you can add this information manually, but where a large number of images are needed this would take a huge amount of time, so I looked for ways to automate the process. If the title and position data are saved in the photo's MetaData , then when I upload the photos to Panoramio, the required information is automatically located and added to their database. That is therefore the obvious approach to take. I normally use the RoboGeo program to geo-tag my photos from a .gpx trackfile, but this time I just wanted to tag some folders of photos from a list of their titles and positions, a task which RoboGeo does not do. The obvious tool to use when working with anything to do with image MetaData is Phil Harvey's excellent and free program 'ExifTool' . It is a command-line program, without a GUI wrapper, which some people may find intimidating, but its extreme versatility makes it second to none, so its worth sticking with it and working out how to use it for yourself. It can be used from the Command Line as mentioned, in a simple DOS Batchfile, or run from a Perl program. I chose the latter method. First of all, I needed to check that the entries in the MetaData that I was writing to were the ones that Panoramio would read. Some early experiments had the position recognised OK, but not the title. After a lot of searching and no information located, I turned for help to the Panoramio Forum , where one of the moderators, Tomas Kohout , kindly did some experiments for me to ascertain exactly what the Panoramio Uploader was happy with. You can view the answer in the Questions and Support > Include Metadata in Photo Uploads thread, but to summarise his information, the following tags need to be written to for the Panoramio Uploader to work correctly:
You can read more about MetaTags on Phil Harvey's Guide to Tag Names page. I now needed to find some way of getting the ExifTool program to read information from a file and write it to each photo in a directory full of many photos. After more searching, I found this Batch GPS into Exif from text file thread on the CPAN Image-ExifTool Forum . The code on that page did a lot of what I wanted, and only required small modifications to adapt for my specific requirements. You can see the full code that I used, after modification, at the bottom of this page. The program is a Perl program, which means that you need Perl installed on your computer to run it. If you don't have Perl, you can get a free installation at the ActivePerl website. Next, you need to install the ExifTool perl module. The installation notes page tell you how to do that - its very easy. Note that it is the 'Full Perl Distribution' section that you want, not the Windows section, as you will be running the batch program from within a Perl environment, not a Windows batch file. We now need to create an .ini file that contains all of the GPS and Title information for our photos. Here is a sample of my file, with entries for 3 photos. [C8308.jpg] {Two yurts with a herd of grazing cattle on the grassy slopes of the mountains.} geotag=46.9480123749921,102.941160562486 [C8309.jpg] {Verdant pastureland with distant mountains.} geotag=46.9530133333333,102.955152666667 [C8322.jpg] {Dragoman Overland truck crossing a rickety wooden bridge.} geotag=46.9755376486486,102.967410554054 Note how the filename for the photo is contained between 2 square brackets, and photo title is contained between 2 curly brackets. The lattitude and longitude values are on the 3rd line, separated by a comma. South or West values are negative. North or East are positive, as show here. You don't need a space between each entry. You need one entry for each photo in your directory. You can have more entries than photos, but not more photos than entries in the .ini file. Create the file in a text editor, such as NotePad, NOT a word processor program such as Word. Save the file with a filename of 'geotest.ini'. If you want to use a different name, change the value at line 36 of the 'batch.pl' code. We are nearly ready to begin! Place the batch program file named 'batch.pl', the photos, and the .ini file named 'geotest.ini' in the same directory i.e. 'C:\geotest'. Click 'Start > Programs > Accessories > Command Prompt' to open a Command Prompt window, and type: 'cd c:\geotest' to change the directory to the one where the batch file program is located. Type: 'batch.pl' and wait a few seconds for the program to work. It will report the names of the files modified, and a total number of the files modified. Occasionally the program will report '0 files modified' even though you know that there are correct entries for the photos in the .ini file. This could be because the EXIF has been damaged during a TIFF > JPG conversion. If this is the case, the photo metadata can be repaired. To do this, download the Windows Stand-Alone Executable from the ExifTool home page and follows the notes in the Windows section of the installation notes . Copy the file 'exiftool.exe' to the directory above the photos, open the Command Prompt, change the directory to the one where exiftool is, and then type:
CODE FOR THE PROGRAM 'batch.pl' : #!/usr/bin/perl -w # # 'batch.pl' - Original code by Phil Harvey http://www.sno.phy.queensu.ca/~phil/exiftool/ # Description: Adds Title and GPS lat/long information to all images in a directory. # Sourced from: http://cpanforum.com/threads/4609 # Modified by Tim Makins www.gnomeplanet.com 2012-07-12 # # General Notes: Panoramio-compatible. Data is specified by the .ini file in line 36. # It takes a while to run as it checks for every photo listed in the ini positions file. # I have disabled the error printing on line 103. Remove the '#' to turn it back on. # # Ini-File Notes: Each photo needs an entry in the .ini file listing filename, title, lat/lon position. # Sample 3-line entry from ini file (remove the # characters) : # [C0392.jpg] # {Interior domes, Islamic caligraphy and artwork in the Sultan Ahmet Camii, or Blue Mosque.} # geotag=41.0053589546692,28.9768658158566 # # To run this batch program: # See http://www.sno.phy.queensu.ca/~phil/exiftool/install.html for ExifTool perl module # installation notes. Place this batch program, the photos, and the .ini file in the same # directory i.e. C:\Programs\ExifTool\geotest # Start > Programs > Accessories > Command Prompt # From the Command Prompt, type: cd c:\programs\exiftool\geotest # From the Command Prompt, type: batch.pl # The program will report the names of the files modified, and a total number. # Open the directory in RoboGeo to see that the values have been successfully modified. # # Error Notes: If some files are not modified, this could be because the EXIF has been # damaged during the TIFF > JPG conversion. If this is the case, try repairing the directory # by putting 'exiftool.exe' in the directory above the photos, open the Command # Prompt, change the directory to the one where exiftool is, and then type: # exiftool -all= -tagsfromfile @ -all:all -unsafe DIRECTORY_NAME # Re-run batch.pl as above, and all should now be OK. # use strict; # name of .ini file my $file = "geotest.ini"; # include the location of exiftool BEGIN { push @INC, "c:/windows/lib" }; use Image::ExifTool; my $exifTool = new Image::ExifTool; # reset the file counter my $count = 0; open FILE, $file or warn("Error opening $file\n"), next; my ($dir,$name,$title); # get the directory of the .ini and image files if ($file =~ /(.*\/)/) { $dir = $1; } else { $dir = './'; } # process the .ini file while ( |
Stock Photograph SearchAdvanced Search PageTag Cloud
0
all
alma-ata
architect
are
argentina
ark
artistic
ashgabat
beijing
bolivia
buddhist
cabinda
canada
car
china
city
creativity
culture
door
doors
end
foz do iguacu
history
horizon
india
kazakhstan
kerala
land
man
men
military
moskovskaya oblast
museum
nature
nizhny novgorod
one
onguday
outdoor
people
rajasthan
representation
rio
russia asiatic
russia european
salta
semipalatinsk
transport
uniform
use
Popular searches on this site. | ||||||||||||||||||||||||
Web design by gnomeplanet.com :: All images and pages on this site are © 2008 - 2024 and remain the property of gnomeplanet.com :: All rights reserved |