So FileTexture and DynamicTextture don’t handle GIF graphics files. Unfortunately I want to read radar images from NOAA (the US weather service), and they only serve GIFs. And yes I know, HTMLTexture can be used to render them.
BUT, if the Width and Height input pins into HTMLTexture are not right, then you get scroll bars added to the image, not nice at all.
So my question: How to get a .gif from the web, and have it always rendered into a texture without scroll bars, no matter it’s size? Bonus points if the texture size corresponds to the original size, as with FileTexture.
writing a quick dynamic plugin should get you some raw bytes and meta data out of a decoder, which you can feed into dynamic texture raw: GifBitmapDecoder Class
was a good example to try out the new async/await keywords of the .NET 4.5 update. this node can load bmp, gif, ico, jpg, png, tiff and wmp images form disk or the web without blocking the vvvv main loop. please test…
Most excellent! It works! Here’s a couple of minor quirks:
The first gif (the earth) has an absolute path so it doesn’t load.
The third gif (the pigeons) stopped loading at about .17, and I had to hit reload for it to load properly. Works that way every time I start the patch.
Although this is perfect for what I needed (static images), it would be cool to get the animated gif frame timing data out as a spread of spreads as well.
@DiMiX do you also experience that the download of the images stops at the first run of the patch and you have to hit reload? i had this here couple of times, but thought its my bad internet connection…
Did some more testing. Definitely problems loading with a spread of URLs. The attached patch gets a directory listing, and then tries to load all the GIFs on that page (usually about 25).
When the patch is first run, about 5 will load, but not necessarily the first ones. If you bang the reload, the first 2 or 3 will load, and banging it further results in 2 to 4 loading, and then once they all loaded after about 5 or 6 bangs. Another time it faulted (see below).
Almost there, thanks tonfilm!
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Media.Imaging.LateBoundBitmapDecoder.get_Frames()
at VVVV.Nodes.ImageLoaderSlice.d__9.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at VVVV.Nodes.ImageLoaderSlice.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__0(Object state)