Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #9078

A user has found that after

from PIL import Image, ExifTags
with Image.open("Tests/images/exif_gps.jpg") as im:
  exif = im.getexif()
  exif.get_ifd(ExifTags.IFD.GPSInfo)
  del exif[ExifTags.IFD.GPSInfo]
  im.save("out.jpg", exif=exif)

the saved image still has GPS data.

This is because get_ifd() populates _ifds, and del exif[ExifTags.IFD.GPSInfo] doesn't clear it. This fixes that.

@radarhere radarhere added the Exif label Jul 10, 2025
@hugovk hugovk merged commit a74e4fa into python-pillow:main Aug 27, 2025
57 checks passed
@radarhere radarhere deleted the del_ifd branch August 27, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is there a way to delete only the GPS data rather than all of the EXIF data?

2 participants