DEV Community

Robertino
Robertino

Posted on

📸 How to Read and Remove Metadata from Your Photos With Python

📚 Smartphones include EXIF metadata in their photos. Here’s how to read, write, and erase it using Python.

The mass adoption of smartphones — essentially portable, sensor-rich, location-aware, always-networked computers — has given us two major consequences whose effects on privacy and security aren’t yet fully understood:

  1. More people than ever have a camera that’s usually within arm’s reach.
  2. By default, the photos taken with these cameras can give away sensitive information, and many users are unaware that it’s happening.

In addition to picture data, photos taken with smartphones and modern digital cameras contain metadata, which is additional information about the photo. This metadata is stored in a format called EXIF, which is short for EXchangeable Image File format, which is a continually evolving standard for information added to digital image and sound recordings.

In photos, EXIF can include information such as:

  • The dimensions and pixel density of the photo
  • The make and model of the device used to take the photo
  • Zoom, aperture, flash, and other camera settings when the photo was taken
  • The orientation of the device when the photo was taken
  • When the photo was taken
  • Where the photo was taken
  • Which direction the camera was facing
  • The altitude at which the photo was taken

This metadata is useful for sorting, cataloging, and searching through photos, which is why the EXIF standard was defined. However, it also introduces privacy and security concerns that many users don’t take into account.

Read more...

Top comments (0)