Commit 39e84d17 authored by ThibG's avatar ThibG Committed by Eugen Rochko
Browse files

Unconditionally re-encode locally-uploaded images to strip metadata (#8714)

This strips metadata on file upload by re-encoding the files, at the cost
of possible slight image quality decrease and processing resources.
parent ccc2f608
Showing with 5 additions and 1 deletion
+5 -1
......@@ -20,7 +20,7 @@ module Paperclip
private
def needs_convert?
needs_different_geometry? || needs_different_format?
needs_different_geometry? || needs_different_format? || needs_metadata_stripping?
end
def needs_different_geometry?
......@@ -31,5 +31,9 @@ module Paperclip
def needs_different_format?
@format.present? && @current_format != @format
end
def needs_metadata_stripping?
@attachment.instance.respond_to?(:local?) && @attachment.instance.local?
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment