View Full Version : display image without writing to disk
kcchesnut
2008-08-25, 21:46
I'm writing a streaming script that shows thumbnails of the stream.
Right now, i'm downloading the thumbnail and then saving to disk before display.
Is there a way to display an image without having to write it to disk first?
Seems like i'd be able to just keep the image in memory to be displayed.
Thanks,
casey
I was actually looking at doing something similar. Looking around I found that urllib.openurl(some_url) (http://docs.python.org/lib/module-urllib.html) may do the trick.
If your getting the same image over an over again you may wish to download it for performance reasons and load it from disk though.
kcchesnut
2008-08-26, 21:23
I haven't figured out how to pass that as a parameter to ControlImage.setImage() to be displayed?
All i've got to work so far is to save that resut to disk, and then pass the file path to ControlImage.setImage(diskPath)
What I assumed I could do would be something like this :
response = urllib2.urlopen(url)
imageBytes = response.read()
controlImage.setImageBytes(imageBytes)
Thanks,
casey
Ah ok, it doesn't look like the ControlImage object supports that.
P.S. What type of streaming script are you writing?
kcchesnut
2008-08-26, 22:59
Internet TV (beta) streams from Media Center Edition
http://www.brains-N-brawn.com/xMceItv/
updated to support thumbnails.
submitted to xbmcscripts a couple days ago.