Skip to content

Instantly share code, notes, and snippets.

@hoshinaoshi
Created November 24, 2013 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoshinaoshi/7629389 to your computer and use it in GitHub Desktop.
Save hoshinaoshi/7629389 to your computer and use it in GitHub Desktop.
How to fix it to appear (image) is rotated uploaded photos in CarrierWave
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
process :fix_exif_rotation
def fix_exif_rotation
manipulate! do |img|
img.auto_orient!
img = yield(img) if block_given?
img
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment