Remove location EXIF data from uploaded photos

Hi guys,
Just found out the hard way that uploaded photos will retain any location (ie. GPS Lat/Lon) data stored in the image’s EXIF (in fact, the whole EXIF is retained, including device, f-stop, white balance, ISO etc data). While I understand there’d be a bit of work involved in stripping any EXIF data out, the removal of at least the location data would be a privacy concern of many users (both current and potential), especially if it’s expected they may be uploading from a mobile device (which they more than likely took said photo on) - while someone might feel comfortable having their home town in their profile, having the GPS coordinates of their house publicly available is likely another story.

「いいね!」 5

That’s a sensible idea, but at the same time I think Discourse shouldn’t be modifying users’ uploaded files unless the user explicitly told it to do so.

This could be an option in the “Add image or file” dialog, however; a “strip private metadata” checkbox, for instance. When images are uploaded via drag&drop and contain problematic EXIF headers, a warning message in the composer should be enough.

「いいね!」 2

I know twitter strips the EXIF headers. And I’m not totally sure how Wordpress does it, but I think if the image is resized the EXIF headers are stripped. I doubt 500px strips any of the headers, but they are more of a photo centric application.

I personally think the private information should be removed but I think we should also look and see what other apps are doing and learn from them.

Would definitely accept a community PR in this area!

Add a checkbox, checked by default, labelled “remove EXIF data”.

「いいね!」 2

You mean you’d put this in as a standard option? I think this is definately plugin territory. Or at least have the ability to turn it off.

Safe by default is what we try to deliver and I think stripping exif data is safer by default. Helps with rotated by metadata images as well, which @zogstrip already completed, right @zogstrip?

「いいね!」 9

Since EXIF data also contains copyright information which can be used to help fight copyright violations, I think it’s a really, really bad idea to strip it - regardless of the fact that Twitter and Pinterest do it.

Removing copyright information might even be illegal in some countries.

(b) Removal or Alteration of Copyright Management Information. — No person shall, without the authority of the copyright owner or the law —

(1) intentionally remove or alter any copyright management information,

I don’t see anything bad about stripping EXIF location, you don’t need to touch copyright

「いいね!」 8

Yes I did.

「いいね!」 1

Looks like the action is here?

def self.fix_image_orientation(path)
  `convert #{path} -auto-orient #{path}`
end

Maybe someone can extend that into a PR to remove EXIF location information.

Unfortunately, after a quick lookup, Image Magick only support stripping all the EXIF information. We’ll need either a new gem or a new tool to deal with that issue properly.

Personally I think that’s fine. If it’s good enough for Pinterest and Twitter, it’s certainly good enough for us.

「いいね!」 5

Discourse は、少なくともデフォルトでは EXIF データを削除すべきではないと考えています。いずれにせよ、グローバルオプションまたはユーザーオプションとして削除する機能を提供すべきです(プラグインとして実装されるかもしれません)。

一部の EXIF データをソーシャルネットワークに公開したくないユーザーは、JPEG として書き出す際に EXIF データを削除すべきです。

写真フォーラムの管理者として、画像の EXIF データはユーザーにとって重要です。

「いいね!」 3

もしかしたら、写真をアップロードする代わりに、Flickr の写真へのリンクを貼るのがあなたにとっての解決策かもしれません。

全くその通りです… 私たちは、サイトへアップロードされる写真がライセンス契約を尊重したものであることを望んでいます。また、当フォーラムを設立した理由は、Flickr や Facebook のようにコメントが得られず「いいね」しか届かない仕組みが気に入らなかったからです。

私たちは写真に対する意見を得るためにこのコミュニティを創設し、写真はこのコミュニティ内に残すことを想定しています。

もしプライバシーや写真に含まれる機微なデータを気にされる場合は、画像をエクスポートする際にそのデータを画像に保存しないようにしてください。

「いいね!」 2

興味深いですね。以前は、Flickr が写真の保存や共有において Facebook とは全く異なり、最もリスペクトのあるオンラインの場だと考えていました。しかし、どちらもしばらく利用していません。個人的には、写真をオフラインと Nextcloud サーバーに保存し、Discourse フォーラムでたまに写真のみを共有しています。

お求めの機能は、Exif データの削除をオプション化できるプラグインのようです。Marketplace でリクエストしてみてください。

最も尊重されるのは 1x、500 ピクセルも同様ですが、Flickr も尊重されています。しかし、Flickr は無料ではなく、Flickr や 500px、その他のサービスが私たちのニーズをどう考えるかに依存することはできません。

私の意図が伝わっていないかもしれません(私の英語が下手で申し訳ありません)。私たちは写真家が互いの写真に対して意見を共有するためのコミュニティです。
Discourse を、すべての、またはほとんどの写真を掲載する場所として利用しているわけではありません。

EXIF 情報は、時に意見を述べる上で役立ちます。

いいえ、プラグインは必要ありません。Discourse の動作変更を求めているのは、プラグインを必要としている人です。

Discourse は現在、EXIF データを提供しており、ファイルから削除していません。

グローバルに削除するか、ユーザー設定として削除するかを選択できるオプションは、良い解決策です。

もちろん、これはプラグインとして実装可能です。

「いいね!」 2

アップロード時に簡単なチェックボックスを追加して拡張することもでき、それは素晴らしい機能になるでしょう。

よく、販売中の部品やアイテムの写真を撮影して、私のスマートフォンから当フォーラムにアップロードすることがあります。そうすると、私の自宅の場所が特定されてしまいます :man_facepalming:

当フォーラムは写真が非常に多いので、EXIF データを保持したままにすることが私たちにとって非常に有用であることに同意します。

ほとんどの場合、その通りです :blush:

「いいね!」 1

はい、一部の EXIF データを削除できる機能を追加するのは素晴らしいアイデアです。

ただし、そのためにはシステム全体で完全な EXIF 管理を実装する必要があります。

最適な選択肢は以下の通りだと考えます:

3 つのオプションを持つグローバルパラメータを設定します:

  • すべての EXIF データを保持(デフォルトで有効。既存のインストールの機能を壊さないようにするため)。
  • アップロードされた画像から EXIF データを除去。
  • ユーザーが EXIF データの除去を選択できるようにする。

グローバルレベルで 3 つ目のオプションが選択された場合、ユーザーには以下の個人設定を提供する必要があります:

  • すべての EXIF データを保持(デフォルトで有効。既存のインストールの機能を壊さないようにするため)。
  • アップロードされた画像から EXIF データを除去。

画像をアップロードする際、システムは画像ごとに画像データの除去オプションを提示できるはずです(保持を選択していても同様です)。
そのオプションは画像アップロードダイアログに追加できます。

理想的には、データを除去するオプションを選択した場合、ユーザーは以下を選択できるようにすべきです:

  • GPS および位置情報のみを除去。
  • 基本データ(カメラおよびレンズのモデル、撮影パラメータ)のみを保持。
  • すべての画像データを除去。
「いいね!」 6