Image gets rotated automatically on upload in Rails

<>

This question already has an answer here:

Answers


Finally i got the solution here https://stackoverflow.com/a/18541893,

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
    end
end 

and used it as:

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

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

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...