def [](value)
case value.to_s
when "format"
run_command("identify", "-format", format_option("%m"), @path).split("\n")[0]
when "height"
run_command("identify", "-format", format_option("%h"), @path).split("\n")[0].to_i
when "width"
run_command("identify", "-format", format_option("%w"), @path).split("\n")[0].to_i
when "dimensions"
run_command("identify", "-format", format_option("%w %h"), @path).split("\n")[0].split.map{|v|v.to_i}
when "size"
File.size(@path)
when "original_at"
Time.local(*self["EXIF:DateTimeOriginal"].split(/:|\s+/)) rescue nil
when /^EXIF\:/i
run_command('identify', '-format', "\"%[#{value}]\"", @path).chop
else
run_command('identify', '-format', "\"#{value}\"", @path).split("\n")[0]
end
end