brendano (owner)

Revisions

gist: 5349 Download_button fork
public
Description:
imageopen - mac commandline
Public Clone URL: git://gist.github.com/5349.git
Embed All Files: show embed
imageopen.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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}"