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.


    Get image URL of any image

    Pythonista
    1
    1
    927
    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.
    • Webmaster4o
      Webmaster4o last edited by Webmaster4o

      It is often useful when porting to this forum to include images. But to properly do this in markdown, you need to upload the image to the web and get a valid URL. This script aims to do that.

      Note: this script requires pyimgur

      import pyimgur,photos,clipboard,os,console
      i=photos.pick_image()
      format = 'gif' if (i.format == 'GIF') else 'jpg'
      i.save('img.'+format)
      clipboard.set('![]('+(pyimgur.Imgur("303d632d723a549").upload_image('img.'+format, title="Uploaded-Image").link)+')')
      console.hud_alert("markdown imagecopied!")
      os.remove('img.'+format)
      

      This will copy markdown code for your image to the clipboard.

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