Image gets rotated automatically on upload in Rails


This question already has an answer here:


Finally i got the solution here,

here are changes i done to get it fixed:

added this in avatar_uploader.rb:

def auto_orient
    manipulate! do |img|
      img = img.auto_orient

and used it as:

  version :thumb, :if => :image? do
    process :auto_orient      // here it is used
    process :crop
    resize_to_fill(100, 100)

  version :large, :if => :image? do
    process :auto_orient      // here it is used
    resize_to_limit(600, 600)

That's it :)

Need Your Help

Setting focus to a Windows application from Node-JS

javascript node.js winapi node-ffi

I have a NodeJS application running on Windows that needs to display and switch the focus to a running Windows application when a user does a certain action. I have been using the node-ffi package...