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 للصور مهمة جدًا لمستخدمينا.

3 إعجابات

ربما تكون الإجابة المناسبة لك هي ربط صور Flickr بدلاً من تحميلها؟

على الإطلاق… نود أن تكون الصور المرفوعة إلى موقعنا محترمة لاتفاقية الترخيص، ولأننا أنشأنا المنتدى لأننا لا نحب Flickr أو Facebook حيث لا تتلقى تعليقات، بل إعجابات فقط.

أنشأنا المجتمع للحصول على آراء حول صورنا، ويجب أن تبقى الصور ضمن المجتمع.

إذا كنت تهتم بخصوصيتك أو بالبيانات الحساسة في صورك، فلا تقم بحفظها في صورتك عند تصديرها.

إعجابَين (2)

مثير للاهتمام. كنت أعتقد أن Flickr هو المكان الأكثر احترامًا عبر الإنترنت لتخزين ومشاركة الصور، وليس على غرار فيسبوك على الإطلاق. لكنني لم أستخدم أيًا منهما منذ فترة. شخصيًا، أقوم بتخزين صوري بشكل غير متصل وعلى خادم Nextcloud، وأشارك فقط صورة عابرة بين الحين والآخر في منتدى Discourse.

يبدو أن ما تحتاجه هو إضافة (plugin) تجعل إزالة بيانات EXIF اختيارية. يمكنك طلب واحدة في Marketplace.

الأكثر احتراماً قد يكون 1x، وكذلك 500 بكسل، وفليكر محترم أيضاً، لكنه ليس مجانياً، ولا يمكننا الاعتماد على ما تعتقده فليكر أو 500 بكسل أو غيرهما فيما يتعلق باحتياجاتنا.

أنت تفوتك النقطة الأساسية (ربما لم أشرحها جيداً، آسف على لغتي الإنجليزية): نحن مجتمع من المصورين الذين يشاركون صورهم للحصول على آراء الآخرين.
نحن لا نستخدم ديسكورس كمكان لنشر جميع أو معظم صورنا.

معلومات EXIF مفيدة أحياناً لإبداء الرأي.

لا، أنا لا أحتاج إلى إضافة، بل من يحتاجها هو من يطلب تغيير سلوك ديسكورس.

حالياً، يقدم ديسكورس بيانات EXIF ولا يقوم بإزالتها من الملف.

توفير خيار لاختيار ما إذا كنت تريد إزالة هذه البيانات عالمياً أو كإعداد تفضيلي للمستخدم هو حل جيد.

يمكن تنفيذ ذلك كإضافة، بالطبع.

إعجابَين (2)

يمكنك توسيع ذلك بإضافة مربع اختيار بسيط أثناء التحميل أيضًا، وهذا سيكون ميزة رائعة.

غالبًا ما أقوم بتصوير أجزاء أو عناصر معروضة للبيع باستخدام هاتفي، ثم أرفعها إلى المنتدى الخاص بنا، مما يكشف عن موقع منزلي :man_facepalming:

المنتدى الخاص بنا غني بالصور أيضًا، لذا أتفق على أن الحفاظ على بيانات EXIF كما هي مفيد جدًا لنا.

في معظم الأوقات :blush:

إعجاب واحد (1)

نعم، إضافة إمكانية حذف بعض بيانات EXIF ستكون رائعة.

لكنك تحتاج إلى إضافة إدارة كاملة لبيانات EXIF إلى النظام لتحقيق ذلك.

أعتقد أن أفضل خيار هو:

تحديد معلمة عامة بثلاثة خيارات:

  • الاحتفاظ بجميع بيانات EXIF (مفعّلة افتراضيًا حتى لا نكسر وظائف التثبيتات الحالية).
  • إزالة بيانات EXIF من الصور المرفوعة.
  • السماح للمستخدم باختيار ما إذا كان يريد إزالة بيانات EXIF.

إذا تم اختيار الخيار الثالث على المستوى العام، فيجب أن يكون لدى المستخدمين تفضيل مستخدم لاختيار:

  • الاحتفاظ بجميع بيانات EXIF (مفعّلة افتراضيًا حتى لا نكسر وظائف التثبيتات الحالية).
  • إزالة بيانات EXIF من الصور المرفوعة.

عند رفع صورة، قد يمنحك النظام خيارًا لإزالة بيانات الصورة على أساس كل صورة على حدة (حتى لو اخترت الاحتفاظ بها).
يمكنك إضافة هذا الخيار في نافذة رفع الصور.

من الناحية المثالية، إذا اختار شخص ما إزالة البيانات، فيجب أن يكون قادرًا على اختيار:

  • إزالة بيانات GPS والموقع فقط.
  • الاحتفاظ بالبيانات الأساسية فقط (نوع الكاميرا والعدسة ومعلمات التصوير).
  • إزالة جميع بيانات الصورة.
6 إعجابات