This strips metadata on file upload by re-encoding the files, at the cost
of possible slight image quality decrease and processing resources.
private
def needs_convert?
- needs_different_geometry? || needs_different_format?
+ needs_different_geometry? || needs_different_format? || needs_metadata_stripping?
end
def needs_different_geometry?
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