#!/usr/bin/ruby Dir.chdir 'thumbs' $stdout.reopen File.open('index.html', 'w') puts '' Dir['*.jpg'].each { |lf| File.unlink lf if Dir['../'+lf[0...-3]+'*'].empty? } Dir['../*'].each { |f| next if not File.file?(f) or f[-3..-1] == '.rb' lf = File.basename(f)[0...-3] + 'jpg' if not File.exist? lf $stderr.puts File.basename(f) system 'convert', f, '-resize', '64x64', lf if not File.exist? lf and File.exist?(lf+'.0') File.rename lf+'.0', lf File.unlink *Dir[lf+'.*'] end end puts "" } puts ''