config/application.rb
のconfig.active_storage.variant_processor
が:vips
に設定されている場合には、saver: { strip: true }
を記述すると画像のExif情報を削除できます。
app/models/user.rb
class User < ApplicationRecord
has_one_attached :avatar do |attachable|
attachable.variant :large, resize_to_fill: [256, 256], saver: { strip: true }
attachable.variant :medium, resize_to_fill: [128, 128], saver: { strip: true }
attachable.variant :small, resize_to_fill: [64, 64], saver: { strip: true }
end
# ...
end