You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to update an Image through a stream source with various permutations of code such as:
SourceStream = new MemoryStream(buffer);
Source = ImageSource.FromStream(() => SourceStream);
Where buffer is a simple byte[] containing pixel values.
This isn't working, but I get some curious errors in the output window:
[Image loading] Image load failed: GLib.GException: Unrecognized image file format
at Gdk.PixbufLoader.Write(Byte[] buf, UInt64 count)
at Gdk.PixbufLoader.LoadFromStream(Stream input, Byte[] streamingBuffer)
at Gdk.PixbufLoader.InitFromStream(Stream stream, Byte[] buffer)
at Gdk.PixbufLoader..ctor(Stream stream, Byte[] streamingBuffer)
at Gdk.Pixbuf..ctor(Stream stream)
at Xamarin.Forms.Platform.GTK.Renderers.StreamImagesourceHandler.d__0.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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Xamarin.Forms.Platform.GTK.Renderers.ImageRenderer.d__5.MoveNext()
As near as I can tell, GDK expects streams to be actual valid image files, such as .png or .jpeg, while Xamarin's API is supposed to just pass around raw buffers wrapped in streams. This is either a Xamarin.Forms GTK bug, or else the documentation badly needs revision. Actually, the documentation needs revision anyway since the only information I can find about what you're supposed to pass in the source stream comes from various forum threads and mailing lists.
The text was updated successfully, but these errors were encountered:
Trying to update an Image through a stream source with various permutations of code such as:
Where buffer is a simple byte[] containing pixel values.
This isn't working, but I get some curious errors in the output window:
[Image loading] Image load failed: GLib.GException: Unrecognized image file format
at Gdk.PixbufLoader.Write(Byte[] buf, UInt64 count)
at Gdk.PixbufLoader.LoadFromStream(Stream input, Byte[] streamingBuffer)
at Gdk.PixbufLoader.InitFromStream(Stream stream, Byte[] buffer)
at Gdk.PixbufLoader..ctor(Stream stream, Byte[] streamingBuffer)
at Gdk.Pixbuf..ctor(Stream stream)
at Xamarin.Forms.Platform.GTK.Renderers.StreamImagesourceHandler.d__0.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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Xamarin.Forms.Platform.GTK.Renderers.ImageRenderer.d__5.MoveNext()
As near as I can tell, GDK expects streams to be actual valid image files, such as .png or .jpeg, while Xamarin's API is supposed to just pass around raw buffers wrapped in streams. This is either a Xamarin.Forms GTK bug, or else the documentation badly needs revision. Actually, the documentation needs revision anyway since the only information I can find about what you're supposed to pass in the source stream comes from various forum threads and mailing lists.
The text was updated successfully, but these errors were encountered: