omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    photo asset.location setting does not set GPS exifs

    Pythonista
    1
    3
    1799
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp last edited by

      I try to use the photos module to set the GPS tags/exifs of a photo.
      If I pick two assets from the camera roll, a1 which has GPS tags and a2 without GPS tags, and if my script does
      a2.location = a1.location
      the standard Photos app shows correctly where the photo has been taken,
      but other applications do not find the GPSInfo exif in the photo file.

      Smallest code for testing, assuming you pick 2 photos, the first one having GPS tags, the 2nd not.

      # coding: utf-8
      import photos
      
      def main():
      	c = photos.get_assets(media_type='image')
      	ps = photos.pick_asset(assets=c, title='Pick photos', multi=True)
      	for p in ps:
      		print(p.location)
      		if p.location:
      			# Photo has GPS tags
      			prev_location = p.location
      		else:
      			# Photos does not have GPS tags, use previous if any
      			if prev_location:
      				p.location = prev_location
      			
      if __name__ == '__main__':
      	main()
      
      1 Reply Last reply Reply Quote 0
      • cvp
        cvp last edited by cvp

        Google Photos app also shows where the photo has been taken.
        ViewExif app does not.
        Pythonista app using "from PIL.ExifTags import TAGS,GPSTAGS" does not see any GPS exifs.
        Exif Viewer app shows where the photo has been taken
        Yes in normal mode
        Not in share mode, strange, isn't it?

        Perhaps, as the photo has been modified by a Pythonista script updating the asset.location, is the photo stored twice, one as original (without GPS tags), a second as modified (with GPS tags)! I really don't know how Apple stores modified photos.

        1 Reply Last reply Reply Quote 0
        • cvp
          cvp last edited by cvp

          Reading a lot about iOS modified Photos, I've learned that the file contains the original photo and some metadata (exifs), Apple MakerNote, contains the data for modifying the photo (filters, added Gps tags, ...).

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Powered by NodeBB Forums | Contributors