title: How to read and image and get blob in ruby
body: <p>I am using a homegrown captcha system. This uses Rmagick and Rmagick comes with ImageList. Existing code is like this.</p>
  
  <pre><code>  im = ImageList.new("#{@@captcha_image_path}/#{captcha.pos}.JPG")
    @imgdata = im.to_blob
  
      send_data(@imgdata, :filename =&gt; 'captcha.jpg', 
                          :type =&gt; 'image/jpeg', 
                          :disposition =&gt; 'inline', 
                          :nocache =&gt; Time.zone.now)   
  </code></pre>
  
  <p>Above code works fine. </p>
  
  <p>Now we are getting rid of Rmagick and we are using MiniMagick. We have generated some large number of images that will be displayed in random here. Now that I do not have access to ImageList, I was wondering how to get the blob data to be sent. Specifically how do I get @imgdata withoug using ImageList.</p>