diff --git a/README b/README index d1dfce0..26569c6 100644 --- a/README +++ b/README @@ -38,4 +38,11 @@ Put photos in containing folders(albums) in the specified gallery folder. This f ./trip to iran/mosque in yazd.jpg ./trip to iran/powder snow in dizin.jpg -Each folder => album \ No newline at end of file +Every time you manually add photos to disk you must run: + + require "scan" + ScanFiles.FullScan + +In future releases this will be automated. + +Uploads will be written to the database and thus no need to manually scan the folders. \ No newline at end of file diff --git a/app/models/photo.rb b/app/models/photo.rb index a12adbc..e439b2b 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -15,7 +15,7 @@ class Photo < ActiveRecord::Base before_destroy :destroy_file attr_accessor :tag_list - attr_protected :path + #attr_protected :path named_scope :untouched, :conditions => "Photos.description IS NULL AND Photos.Id NOT IN ( SELECT Photo_ID FROM Photo_Tags)", :include => :album @@ -109,6 +109,9 @@ class Photo < ActiveRecord::Base end def exif_read + puts "exif" + puts self.path + puts self.path_original photo = MiniExiftool.new(self.path_original) self.longitude = photo.GPSLongitude if self.longitude.nil? self.latitude = photo.GPSLatitude if self.latitude.nil?