Created
December 20, 2012 08:07
-
-
Save anonymous/4343697 to your computer and use it in GitHub Desktop.
extract GPS info and print a Google Maps URL in the terminal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem 'exifr', github: 'remvee/exifr' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
require 'bundler/setup' | |
Bundler.require(:default) | |
ARGV.each do |img| | |
gps = EXIFR::JPEG.new(img).gps | |
unless gps | |
puts "#{img} => no GPS data" | |
next | |
end | |
puts "\n#{img}\nhttp://maps.google.com/maps?q=loc:#{gps.latitude},#{gps.longitude}" | |
end | |
puts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install and run | |
bundle install | |
chmod +x map.rb | |
./map.rb IMG1.jpg IMG2.jpg | |
# outputs something like | |
IMG1.jpg | |
http://maps.google.com/maps?q=loc:52.7197888888889,5.28397777777778 | |
IMG2.jpg | |
http://maps.google.com/maps?q=loc:35.7197888888889,139.7197888888889 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
created when not signed in...... sigh