title: How to change Rails app for Paperclip + ImageMagick
body: <p>I want to resize an image on the fly in Rails application. Everybody suggests using <strong>Paperclip</strong> gem.</p>
  
  <p>The problem is: I ALREADY HAVE column with pictures:</p>
  
  <pre><code>add_column :users, :picture, :binary, :null =&gt; true
  </code></pre>
  
  <p>and the application already has the code to upload this image. PostgreSQL database already has a column of "bytea" type.</p>
  
  <p><strong>May I not change the database structure</strong> and only do some changes to controller's method?:</p>
  
  <pre><code>def current_user_image
    if current_user.picture
      send_data current_user.picture #Do something here using Paperclip
    else
      send_file File.join(Rails.root, 'public', 'images', 'no_user_pic.png')
    end
  end
  </code></pre>
  
  <p><strong>Related topics:</strong></p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/8520062/image-resize-in-ruby-on-rails">Image resize in ruby on rails</a></li>
  </ul>