Files
fetsite/config/initializers/carrierwave.rb
2013-09-13 01:44:07 +02:00

33 lines
686 B
Ruby

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|
img.write(current_path){ self.quality = percentage } unless img.quality == percentage
img = yield(img) if block_given?
img
end
end
# Strips out all EXIF information
def strip
manipulate! do |img|
img.strip!
img = yield(img) if block_given?
img
end
end
end
end