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.


    Saving an Image to the Camera Roll from a URL

    Pythonista
    1
    1
    1454
    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.
    • JordanPatterson28
      JordanPatterson28 last edited by

      I found a small piece of code posted on this forum to save an image from a url to the camera roll and it works very well. I added a small text manipulation of the URL and a notification below but I have one issue. The image saved to the camera roll has no EXIF metadata. Am I doing somthing wrong or is this not possible?

      Thanks

      import Image
      import photos
      import clipboard
      import notification
      import sys
      import webbrowser
      import console
      import urllib
      from urllib import urlopen
      from io import BytesIO

      webbrowser.open('drafts://')

      dburl = clipboard.get()
      url = dburl.replace('www', 'dl')

      img = Image.open(BytesIO(urlopen(url).read()))
      photos.save_image(img)

      notification.schedule('Photo saved to camera roll', 1, 'default',)

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