1

I'm using a combination of exiftool and PIL to geotag and resize imagery. I've geotagged the full resolution images and now want to create lower resolution images for web hosting. Using PIL I have resized them but it looses the Geotag data. does anyone know of a way to maintain the EXIF metadata on the img.save

many thanks

basewidth = 3680
img = Image.open(INPUTFILE)
wpercent = (basewidth / float(img.size[0]))
hsize = int((float(img.size[1]) * float(wpercent)))
img = img.resize((basewidth, hsize), PIL.Image.ANTIALIAS)
img.save(INPUTFILE + "_LowRes.jpg")

1 Answers1

0
import jpeg
jpeg.setExif(jpeg.getExif('foo.jpg'), 'foo-resized.jpg')

http://www.emilas.com/jpeg/

Answered here: Resize image in Python without losing EXIF data

Laurent'
  • 2,611
  • 1
  • 14
  • 22
Max Uppenkamp
  • 974
  • 4
  • 16