LoginSignup
5
5

More than 5 years have passed since last update.

carriewaveでExifの回転情報をいい感じにする

Posted at
class ImageUploader < CarrierWave::Uploader::Base
  include CarrierWave::MiniMagick
  process :fix_rotate

  def fix_rotate
    manipulate! do |img|
      img.auto_orient
      yield(img) if block_given?
      img
    end
  end
end
5
5
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5