Rewrite exif... path to images


#1

Still working on rewriting exif data to correct the GPS altitude of pix taken by a Mavic 2 Pro. Got it working on one file… now just need to get it working on a whole directory… which leads to my question… was is the path to images uploaded through WebODM.

import piexif
from PIL import Image
fname = “DJI_0387.JPG”

img = Image.open(fname)
exif_dict = piexif.load(img.info[‘exif’])

altitude = exif_dict[‘GPS’][piexif.GPSIFD.GPSAltitude]
print(altitude)
exif_dict[‘GPS’][piexif.GPSIFD.GPSAltitude] = (300, 1) // 300 is the new altitude in meters
exif_bytes = piexif.dump(exif_dict)
img.save(’_%s’ % fname, “jpeg”, exif=exif_bytes)


#2

In WebODM you can look at: