I was receiving "The process cannot access the file because it is being used by another process" error on windows. This fix closes tempfile so jpegtran can write it, reopens just after it. Tempfile.close doesnt unlink file, just releases the handle ( http://ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html )
I was receiving "The process cannot access the file because it is being used by another process" error on windows. This fix closes tempfile so jpegtran can write it, reopens just after it. Tempfile.close doesnt unlink file, just releases the handle ( http://ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html )