>>>>> "B" == Bashar A Asad <baasad / qualitynet.net> writes: B> n = no_ext(f) You remove the suffix '.gif' to `f' and store the result in `n' B> img.write("filename"=>f+"thumb.gif") ^ but here you re-use `f' and not `n' B> end B> Dir.foreach(dir){|file| B> createThumbFile(file) B> } B> and didn't work, the error message below B> ----------------------------------------------------------------- B> /usr/lib/ruby/1.6/magick.rb:63: warning: Unable to open file: . (330) ^^^ Dir#foreach give all entries : this mean that you have `.' (current directory) and `..'. You must filter these entries (with a test) or use Dir::glob to have only the filenames that you want Guy Decoux