2014-05-21 61 views
4

我有一个包含三种样式(拇指,小,原始)图像的后期模型。删除使用回形针上传的原始图像的exif

我想删除由回形针创建的每个图像的exif,所以我在convert_options中使用“-strip”,但后来发现exif仍然存在于原始样式中。

我能做些什么来移除它?

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

回答

4

原始风格将永远包含原始图像,不管是什么。 你可以做的是创建一个额外的风格,像original-no-exif,然后取出真实原始图像(你可以做到这样:Rails and Paperclip... don't save the original image, just the styles?

+0

分配空字符串为“原始无EXIF”使回形针创建相同大小的图像,但语法很奇怪。有没有其他的选择? – atitan

+0

我不这么认为。也许你甚至可以创建“原创”风格,就像这里指出的一样:http://stackoverflow.com/questions/3219787/how-do-i-tell-paperclip-to-not-save-the-original-file –