ADD: Rotate Image via EXIF Information
This commit is contained in:
@@ -30,7 +30,11 @@ class FotoUploader < CarrierWave::Uploader::Base
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# general settings
|
||||
process :fix_exif_rotation
|
||||
process :strip
|
||||
process :convert => 'jpg'
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
version :thumb do
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
module CarrierWave
|
||||
module RMagick
|
||||
|
||||
# Rotates the image based on the EXIF Orientation
|
||||
def fix_exif_rotation
|
||||
manipulate! do |img|
|
||||
img.auto_orient!
|
||||
img = yield(img) if block_given?
|
||||
img
|
||||
end
|
||||
end
|
||||
|
||||
# Manipulates quality settings of image
|
||||
def quality(percentage)
|
||||
manipulate! do |img|
|
||||
|
||||
Reference in New Issue
Block a user