Created
August 14, 2008 02:09
-
-
Save brendano/5349 to your computer and use it in GitHub Desktop.
imageopen - mac commandline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# imageopen - # for mac, commandline open an image file without needing an extension, recognition via imagemagick | |
# [email protected] (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}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment