Skip to content

Ruby gem loading GPS position from photo's EXIF informations into Rails models

License

Notifications You must be signed in to change notification settings

aufi/photo_geoloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhotoGeoloader

Gem Version Build Status

Ruby gem loading GPS position from photo's EXIF informations into (Rails) models.

Created and tested for photos from iPhone and placing it to model.

Usage

Simplest - load position data and handle on your own

photo = PhotoGeoloader.new('path/to/photo.jpg')
p photo.position[:latitude]
p photo.position[:longitude]
p photo.position[:altitude]

Rails model example

# attributes: photo (string, carrierwave uploader), latitude (float), longitude (float), altitude (float)
class Photo < ActiveRecord::Base
  attr_accessible :photo
  mount_uploader :photo, MyPhotoUploader
  before_create do
    PhotoGeoloader.new(photo.path).place_attributes self
  end
end

License

Released under MIT license

About

Ruby gem loading GPS position from photo's EXIF informations into Rails models

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages