drawBot.misc.DrawBotError: No image found at http:...



  • Re: can't fetch image from url (python3 version)

    This topic was semi-resolved already, but I am running into it also.

    I am running the image.py code from the site.

    # the path can be a path to a file or a url
    image("http://f.cl.ly/items/1T3x1y372J371p0v1F2Z/drawBot.jpg", (100, 100), alpha=.3)
    

    and I am getting this error:

    Traceback (most recent call last):
      File "drawBot/ui/drawBotController.pyc", line 119, in createContext
      File "drawBot/drawBotDrawingTools.pyc", line 121, in _drawInContext
      File "drawBot/context/baseContext.pyc", line 2365, in image
      File "drawBot/context/pdfContext.pyc", line 276, in _image
      File "drawBot/context/pdfContext.pyc", line 270, in _getImageSource
    drawBot.misc.DrawBotError: No image found at http://f.cl.ly/items/1T3x1y372J371p0v1F2Z/drawBot.jpg
    

    I am using DrawBot 3.120

    Thanks



  • hello @ChrisSwift,

    I think the error message is correct: there really isn’t any image at this URL. if you paste it in a browser, you will be redirected to another domain where the image is hosted.

    it works fine if you use the actual image URL:

    image("https://s3.amazonaws.com/f.cl.ly/items/1T3x1y372J371p0v1F2Z/drawBot.jpg", (100, 100))
    

    not sure if this is a DrawBot bug…

    cheers!



  • huh...ya that worked.

    It seems a little hit or miss for me.

    I tried
    https://placekitten.com/1000/1000 and it does not work
    but I tried
    https://user-images.githubusercontent.com/6069803/60276528-cc99f100-98c9-11e9-8a34-a749eef157a3.png
    and it did work

    Glad to know that it can work, but I am just running into something odd.

    Thanks


  • admin

    The kitten example is not the url to the actual image data.

    The url to an image needs to be a direct link to the image data, no html, no javascript.

    good luck!