skip zoomifying if the image is less recent than the tiles

This commit is contained in:
Donald Ball 2008-11-24 20:37:26 -06:00
parent 5b81654afc
commit 0ebc3a3d28
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ module Zoomifier
#filename = File.expand_path(filename) #filename = File.expand_path(filename)
outputdir = File.dirname(filename) + '/' + File.basename(filename, '.*') outputdir = File.dirname(filename) + '/' + File.basename(filename, '.*')
raise ArgumentError unless filename != outputdir raise ArgumentError unless filename != outputdir
if File.directory?(outputdir) && File.file?(outputdir + '/ImageProperties.xml') && File.mtime(filename) <= File.mtime(outputdir + '/ImageProperties.xml')
return
end
FileUtils.rm_rf(outputdir) if File.exists?(outputdir) FileUtils.rm_rf(outputdir) if File.exists?(outputdir)
Dir.mkdir(outputdir) Dir.mkdir(outputdir)
tmpdir = "#{outputdir}/tmp" tmpdir = "#{outputdir}/tmp"