Sha256: 9784dd4172b824e4373ad85b2c834d2112f813bc7ed541b2578df7248fe4699f
Contents?: true
Size: 791 Bytes
Versions: 45
Compression:
Stored size: 791 Bytes
Contents
require 'mimemagic' module Bizside module Uploader module Exif extend ActiveSupport::Concern included do process :auto_orient process :strip end private def auto_orient return unless self.model.valid? mime = MimeMagic.by_path(self.file.path) return unless mime and mime.image? manipulate! do |img| img.auto_orient img = yield(img) if block_given? img end end def strip return unless self.model.valid? mime = MimeMagic.by_path(self.file.path) return unless mime and mime.image? manipulate! do |img| img.strip img = yield(img) if block_given? img end end end end end
Version data entries
45 entries across 45 versions & 1 rubygems