I\'m trying to upload a PNG and save a bunch of thumbnails. The thumbnails should all be JPG and not have any transparency. Somehow the file is saved as jpg but it has transpare
There appears to be a quirk with imagemagick and order of operations when converting file types.
Full github issue can be found here: https://github.com/carrierwaveuploader/carrierwave/issues/133#issuecomment-615254
Basically manipulate
is called once for every process
you have. manipulate
opens the current file path, makes changes then writes. Because of this it seems that any process
lines that are called after the format conversion are performed on the original file, not the newly converted one.
In order to fix this, you either have to do all of your process
operations within a single manipulate
block or make sure that the conversion is the last process
to run.
The example of this from the github issue is:
process :convert_and_scale
def convert_and_scale
manipulate! do |img|
img.format 'png'
img.resize '100x32'
img
end
end