mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-15 03:15:32 +00:00
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.
This commit is contained in:
parent
ccc2f608c5
commit
39e84d174d
|
@ -20,7 +20,7 @@ module Paperclip
|
||||||
private
|
private
|
||||||
|
|
||||||
def needs_convert?
|
def needs_convert?
|
||||||
needs_different_geometry? || needs_different_format?
|
needs_different_geometry? || needs_different_format? || needs_metadata_stripping?
|
||||||
end
|
end
|
||||||
|
|
||||||
def needs_different_geometry?
|
def needs_different_geometry?
|
||||||
|
@ -31,5 +31,9 @@ module Paperclip
|
||||||
def needs_different_format?
|
def needs_different_format?
|
||||||
@format.present? && @current_format != @format
|
@format.present? && @current_format != @format
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def needs_metadata_stripping?
|
||||||
|
@attachment.instance.respond_to?(:local?) && @attachment.instance.local?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue