Image info from blogging.rb


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.