Skip to main content
9 of 12
added 26 characters in body
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404

Import EXIF - Metadatas's into attributes fields in QGIS

I would like to import EXIF & metadatas of JPG images into QGIS. For each image, a vector were created by 'ImportPhotos' pluggin, it adds some EXIF into attributes fields but some importants EXIF informations are missing.

In fact, I need 3 more fields. The XMP tags I need are: GimbalYawDegree, FlightYawDegree, RelativeAltitude value are real. That's why I've created 3 new columns (attributes fields) named: GimbalYawDegree, FlightYawDegree, RelativeAltitude.

I would like to create a python script to run a batch for every feature (img imported by ImportPhotos) of a layer. The task would :

  • import the XMP datas of images stored at the path located into the attribute field named "Path"

      import PIL.ExifTags
      exif = {
          PIL.ExifTags.TAGS[k]: v
          for k, v in img._getexif().items()
          if k in PIL.ExifTags.TAGS
      }
    

This code should read the EXIF but this is my first experience in Python and I'm not able to finish the job.

zlikotp
  • 34
  • 2
  • 19