2014-05-21 97 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 –