This file contains 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
<a href="http://www.flickr.com/photos/floridamemory/4989625093/" title="Child and dog by State Library and Archives of Florida, on Flickr"> | |
<img src="http://farm5.staticflickr.com/4125/4989625093_ff64f876d9_n.jpg" width="229" height="320" alt="Child and dog"> | |
</a> |
This file contains 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
# Extract EXIF metadata from a photo on the server | |
get '/tutorial_22_demo_1' do | |
# load the library file that contains methods used this tutorial | |
require 'lib/tutorial_22.rb' | |
# Extract the metadata from an image file on the server | |
@photo = MiniExiftool.new(File.join(root_dir, "/public/assets/photo_metadata_1_400.jpg")) | |
# Get the Latitude and Longitude values and convert to decimal format |
This file contains 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
<img src='/assets/photo_metadata_1_400.jpg' alt='photo of snow geese in Skagit Valley, WA, USA'> | |
<br> | |
<div id="map_canvas"></div> | |
<br> | |
Latitude / Longitude <%= sprintf("%10.5f", @latitude_0) %>, <%= sprintf("%10.5f", @longitude_0) %> | |
<br> | |
<br> | |
<h2>Dump of all the Metadata for this Image</h2> | |
<table> |
This file contains 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
# lib/tutorial_22.rb - methods related to tutorial_22 | |
require 'mini_exiftool_vendored' | |
# Convert Lat Lon in Deg, Min, Sec to Decimal format | |
# e.g 122 deg 25' 25.20" W -> 122.42366666 | |
def dms_to_decimal(coordinate) | |
decimal = 0.0 | |
if coordinate =~ /^(\d+)\s+deg\s+(\d+)\'\s+([\d\.]+)\"\s+(\S)\s*$/ | |
deg = $1.to_f |
This file contains 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
<h2>Geocode</h2> | |
<p>Enter Address <input type='text' id='address_in' size='50'> and hit Return</p> | |
<p>e.g. The White House, Washington DC</p> | |
<p>Latitude : <span id='latitude'></span></p> | |
<p>Longitude : <span id='longitude'></span></p> | |
<br> | |
<h2>Reverse Geocode</h2> | |
<p>Enter Latitude, Longitude Pair <input type='text' id='coordinates' size='50'> and hit Return</p> | |
<p>e.g. 38.897847,-77.036499</p> |
This file contains 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
<p>Web Apprentice Gravatar</p> | |
<pre>http://www.gravatar.com/avatar/68bbbd2c1cefab1b0104d53cd6a15bab?s=80</pre> | |
<img src="http://www.gravatar.com/avatar/68bbbd2c1cefab1b0104d53cd6a15bab?s=80" alt='gravatar for Web Apprentice' /> | |
<br> <br> | |
<p>Default Gravatar</p> | |
<pre>http://www.gravatar.com/avatar/00000000000000000000000000000000?s=80</pre> | |
<img src="http://www.gravatar.com/avatar/00000000000000000000000000000000?s=80" alt='default gravatar'/> | |
<br> <br> | |
<p>Specific Default Gravatar - 'mm'</p> |
This file contains 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
<!-- depends on gems: sinatra/rack and useragent --> | |
<style> | |
th { | |
white-space: nowrap; | |
text-align: left; | |
vertical-align: baseline; | |
font-weight: normal; | |
color: darkred; | |
} |
This file contains 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
<style> | |
.spinner { | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
} | |
</style> | |
<script src="/javascripts/spin.js"></script> | |
<script> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.