forked from bofh/fetsite
ADD: Rotate Image via EXIF Information
This commit is contained in:
@@ -30,7 +30,11 @@ class FotoUploader < CarrierWave::Uploader::Base
|
|||||||
# def scale(width, height)
|
# def scale(width, height)
|
||||||
# # do something
|
# # do something
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
# general settings
|
||||||
|
process :fix_exif_rotation
|
||||||
process :strip
|
process :strip
|
||||||
|
process :convert => 'jpg'
|
||||||
|
|
||||||
# Create different versions of your uploaded files:
|
# Create different versions of your uploaded files:
|
||||||
version :thumb do
|
version :thumb do
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
module CarrierWave
|
module CarrierWave
|
||||||
module RMagick
|
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
|
# Manipulates quality settings of image
|
||||||
def quality(percentage)
|
def quality(percentage)
|
||||||
manipulate! do |img|
|
manipulate! do |img|
|
||||||
|
|||||||
Reference in New Issue
Block a user