LoginSignup
0
0

【Rails】画像のExif情報を削除する方法【ActiveStorage】

Last updated at Posted at 2024-04-25

config/application.rbconfig.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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0