1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Removed dependence on mini_exiftool. We'll need to write a paperclip

processor that uses Imagemagick to get the appropriate details.
This commit is contained in:
Dan Barber 2011-10-31 18:23:25 +00:00
parent f638aeac35
commit 8da575ba41
3 changed files with 10 additions and 14 deletions

View File

@ -46,7 +46,7 @@ gem 'pg'
gem 'devise'
gem 'formtastic'
gem 'squeel'
gem 'mini_exiftool'
#gem 'mini_exiftool'
gem 'will_paginate'
gem 'rdiscount'
gem 'paperclip'

View File

@ -79,7 +79,6 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.17.2)
mini_exiftool (1.3.1)
multi_json (1.0.3)
orm_adapter (0.0.5)
paperclip (2.4.5)
@ -171,7 +170,6 @@ DEPENDENCIES
haml
hpricot
jquery-rails
mini_exiftool
paperclip
pg
powder

View File

@ -1,5 +1,3 @@
require 'mini_exiftool'
class Photo < ActiveRecord::Base
has_and_belongs_to_many :categories
@ -17,7 +15,7 @@ class Photo < ActiveRecord::Base
:bucket => 'danbarberphoto',
:url => ":s3_eu_url"
after_create :get_exif
#after_create :get_exif
@@per_page = 11
@ -45,12 +43,12 @@ class Photo < ActiveRecord::Base
self.save
end
private
def get_exif
exif = MiniExiftool.new photo.queued_for_write[:original].path
self.title = exif.title if self.title.empty?
self.description = exif.description if self.description.empty?
self.taken_at = exif.date_time_original
self.save
end
#private
#def get_exif
# exif = MiniExiftool.new photo.queued_for_write[:original].path
# self.title = exif.title if self.title.empty?
# self.description = exif.description if self.description.empty?
# self.taken_at = exif.date_time_original
# self.save
#end
end