Posted By

gtcaz on 03/19/07


Tagged

ruby e e-texteditor imageinfo


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

bbebop
webstic


Image info from blogging.rb


 / Published in: Ruby
 

  1. height_width = ""
  2. image_info_cmd = ENV['TM_BUNDLE_SUPPORT'] + "/bin/ImageInfo"
  3. image_winfile = %x{cygpath -w "#{full_path}"}.chomp
  4. width, height = %x{"#{image_info_cmd}" "#{image_winfile}" }.split[2, 3]
  5. if height && width
  6. height_width = %Q{ height="#{height}" width="#{width}"}
  7. end
  8. print %Q{<img src="#{url}" alt="${1:#{CGI::escapeHTML alt}}"#{height_width}#{ENV['TM_XHTML']}>}
  9.  

Report this snippet  

You need to login to post a comment.