This commit is contained in:
Espen Antonsen 2009-08-01 20:32:47 +02:00
parent 98f65e3469
commit 947cb93ff8

View file

@ -1,14 +1,15 @@
module ScanFiles
# protected
require "find"
#require 'RMagick'
supported_files = ["jpeg", "jpg", "gif", "png"]
def self.FullScan
prevalbum = ""
dirs = Find.find( APP_CONFIG[:photos_path] ).collect
dirs.sort.each { |path|
dirs = Array.new
Find.find( APP_CONFIG[:photos_path] ) { |path|
dirs.push( path )
}
dirs.sort.each{|path|
if File.file?(path) && [".jpeg", ".jpg", ".gif", ".png"].include?( File.extname(path) )
relpath = File.dirname( path ).sub(APP_CONFIG[:photos_path], '')
relfile = path.sub(APP_CONFIG[:photos_path], '')