Jump to content

Strip EXIF location data of posted images on ImageMagick


Recommended Posts

Currently, all metadata, including GPS data, is preserved on all uploaded images when using ImageMagick (but I believe not GD - it seems to be stripped on this site). Many phones have location tagging enabled by default, and users are unaware that uploading their photos might compromise their location. In the gallery, location data can be retained in the optional map, but in the image itself, and everywhere else on the site, I think GPS data should be stripped to protect users' privacy.

How accurate is the GPS data, you may ask? My location was accurate to within under 10m. If I posted my test image here, you, and the rest of the internet, would get a terrifying amount of information about me.

nb. I've only checked with 4.2, so it is possible that this was changed for 4.3.

Link to comment
Share on other sites

  • 4 weeks later...

One of my members earlier today panicked, posting several comments, PMs, posting in Chatbox after uploading a photo taken in his home. 


NEED HELP!! for some reason when I posted about my comics it gave my exact location and device I used?! I can't fix it either!? 

I'm using 4.3.3 and GD2, although I recently installed Image Magick but haven't switched to it yet.

I was able to switch off the map that showed in the light box for that image, but only after several attempts. It wouldn't toggle off at first. He had uploaded several images taken in his home, but only 1 had the location details.

Disaster averted, I've since spent some time trying to find any settings for image/map privacy, so far without success. I'm sure they used to exist.

Is there anyway to set default options or alert via the uploader the image or images contain location data, and offer to enable the map or strip it out? Or can you bulk from images remove via a tool?

I know the GPS coordinates can be a great idea for lots of Galleries, some great uses, but not always.


Link to comment
Share on other sites

Thanks! I honestly tried that before posting as I'd remembered seeing such options on previous Gallery 4.2.x but they didn't show, so I'll do further tests. That said, it stopped inserting the third party processors into my Privacy Policy once I'd finished editing it after a few hours as well!

There again, I was cursed with bad luck by a witch many years ago, guess it hasn't warn off yet! :unsure:

Link to comment
Share on other sites

Aha, confusion sorted. It's actually the other way around.

On 5/1/2018 at 10:16 PM, Colonel_mortis said:

GPS data, is preserved on all uploaded images when using ImageMagick (but I believe not GD - it seems to be stripped on this site). 


On 5/2/2018 at 1:39 PM, bfarber said:

GD inherently strips exif data, yes. I suppose we could look at adding an option to do this for ImageMagick.

I was using GD2 but you don't get the option to remove Exif data with GD2 in the AdminCP. I switched to Image Magick and the option then shows to remove it. 

With the option to remove EXIF data switched off, the map is shown by default. If you click on each photo individually, you find the Show Map option which is toggled on by default 



So off the top of my head, there's a couple of privacy and convenience improvements that could be made here:

  • With the GDPR principle in mind (of 'opt-in'), have the Show Map disabled by default, in case the user doesn't think about clicking on each image to find it, as in the case of my new member.
  • Add a bulk toggle option button for Show Map/Strip EXIF data to the other buttons (set copyright/credit on all), so you can do it for 100's of image's at once.
  • Make available all of these useful bulk edit tools available elsewhere, such category and albums, so they are not limited to time of upload and you can then apply to existing images.

I don't know if you can opt to just remove GPS coordinates when stripping the EXIF data, as exposure, aperture, device, focus, etc are not personal data and still useful.

Many thanks!



Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
On 5/29/2018 at 2:56 PM, bfarber said:

When uploading, the user can click on their images and choose whether or not to enable or disable the map (it defaults to enable as I recall).

If the user disables the map, the EXIF data is still retained on the image (when using Imagemagick), so this gives the user a dangerous false sense of security that their location is private. All I need to do is download the image and I can extract the location.

Link to comment
Share on other sites

3 minutes ago, Colonel_mortis said:

Downloading the image was the thing I originally posted in the OP...

But glad to hear that you're working on it.

Sorry, the topic sort of veered off track.

We added a setting for ImageMagick in a previous release that allows you to strip EXIF data from uploaded images. This covers attachments (and, generally, images used anywhere else throughout the software).

Gallery, specifically, has an interest in retaining EXIF data of course. If you choose not to display a map, we do not show the location data in Gallery, but as you noted it is still embedded into the original image. This aspect is what we're looking at improving in the next release (how we handle the original image download).

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...