Remove animation for image uploads
This commit is contained in:
parent
a70b967919
commit
77a801d6ad
|
@ -8,7 +8,7 @@ class BaseUploader < CarrierWave::Uploader::Base
|
|||
# Store original size
|
||||
version :original
|
||||
|
||||
# Process cropping on upload
|
||||
process :remove_animation
|
||||
process :cropping
|
||||
|
||||
def content_type_whitelist = %w[image/jpeg image/gif image/png]
|
||||
|
@ -33,4 +33,10 @@ class BaseUploader < CarrierWave::Uploader::Base
|
|||
image.crop "#{w}x#{h}+#{x}+#{y}"
|
||||
end
|
||||
end
|
||||
|
||||
def remove_animation
|
||||
return unless content_type == "image/gif"
|
||||
|
||||
manipulate!(&:collapse!)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue