Search code examples
ruby-on-railspaperclipexif

Remove exif from original image uploaded using paperclip


I have a post model which contains a image in three styles(thumb, small, original).

I want to remove the exif from every image created by paperclip, so I use "-strip" in the convert_options, but later found the exif still exists in the original style.

What can I do to remove it?

has_attached_file :image, {
  styles: { thumb: ["250x250>", :jpg], small: ["125x125>", :jpg] },
  convert_options: { all: "-quality 80 -interlace Plane -strip" }
}

Solution

  • original style will always contain original image, no matter what. What you can do is to create an additional style, like original-no-exif, and then remove the real original image (you can do it this way: Rails and Paperclip... don't save the original image, just the styles?)