问题
Using Paperclip Gem in a Rails 4 project to attach an image and then clean out all exif data, like this:
has_attached_file :image,
styles: lambda{ |a|
{
large: ['800x', :png],
thumb_340: ['340x340#', :png],
thumb_180: ['180x180#', :png]
}
},
convert_options: { all: '-strip' }
Problem is, convert_options
isn't getting called on the original image. What's the best method for reprocessing (or pre-processing) the original to make sure that '-strip'
gets called?
回答1:
try this
has_attached_file :image,
styles: lambda{ |a|
{
original: {convert_options: '-strip'},
large: ['800x', :png],
thumb_340: ['340x340#', :png],
thumb_180: ['180x180#', :png]
}
}
来源:https://stackoverflow.com/questions/35415482/how-to-set-paperclip-to-process-original-image