Tuesday, April 12, 2011

SHARE - How to get image information using RMagick

    require 'RMagick'
    include Magick
    begin
      image=Image.read(pic_full_path).first
      image.filename #filename
      image.filesize #filesize
      image.columns #width
      image.page.width #width
      image.rows #height
      image.page.height #height
    rescue Exception => e
      puts e.inspect
    end

No comments:

Post a Comment