Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 1.01 KB

README.md

File metadata and controls

34 lines (29 loc) · 1.01 KB

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