#!/usr/bin/env ruby # imageopen - # for mac, commandline open an image file without needing an extension, recognition via imagemagick # brenocon@gmail.com (brendan o'connor) require 'fileutils' f = ARGV[0] type = %x[identify #{f}].split[1].downcase tmp = "/tmp/tmp.#{$$}.#{type}" FileUtils.cp f, tmp puts "--> #{tmp}" system "open #{tmp}"