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
|
# Store original size
|
||||||
version :original
|
version :original
|
||||||
|
|
||||||
# Process cropping on upload
|
process :remove_animation
|
||||||
process :cropping
|
process :cropping
|
||||||
|
|
||||||
def content_type_whitelist = %w[image/jpeg image/gif image/png]
|
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}"
|
image.crop "#{w}x#{h}+#{x}+#{y}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def remove_animation
|
||||||
|
return unless content_type == "image/gif"
|
||||||
|
|
||||||
|
manipulate!(&:collapse!)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue