How to delete EXIF ​​(camera) data from a carrier image?

Somebody knows? There was a special config command with paperclip.

Removing camera data from an image is saved 25-30 Kbytes per file. This is very sensitive if we make many versions (large, small ...). In small images, the actual file size without this information can be 5-6 times smaller.

Thanks in advance!

+10
ruby-on-rails exif carrierwave
source share
1 answer

Carrierwave is very flexible and allows you to create your own processors. With MiniMagick, we can use several options for mogrify command line, one of which is strip:

 class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick version :small do process :resize_to_fill => [100, 100] process :strip end def strip manipulate! do |img| img.strip! img = yield(img) if block_given? img end end end 
+24
source share

Source: https://habr.com/ru/post/651323/


All Articles