I put the strip method in the CarrierWave initializer:
def strip
manipulate! do |img|
img.strip!
img = yield(img) if block_given?
img
end
end
and call on the uploader:
version :thumb do
process :resize_to_fit => [180, nil]
process :quality => 70
process :strip
end
Now Rails spits out this error:
undefined method `strip!’ for #
Undefined #strip Method
You define your method like so:
but it’s unclear from your code sample whether img actually has a #strip or #strip! method. The error is complaining about a bang method being undefined, so try
img.stripinstead.Introspection
If that doesn’t work, you may want to insert some debugging code in the method so that you can see what img really is, and what methods it actually supports. For example:
Hope that helps.
See Also
CarrierWave::MiniMagick