Image tag crashed

I’ve just add a simple Image tag, the preview crashed on the Local and the iOS simulator.

MainView.ux

<App Theme="Basic">
    <DockPanel>
        <Image File="Masks/Flower.png"></Image>
    </DockPanel>
</App>

project file:

Attached ZIP file

Version: 0.12.4

logs:

Unexpected fatal error! Please report this to us.
Build started: FullCompile
Configuring (2.64s)
Compiling syntax tree (1.74s)
Generating code and data (1.88s)

Build completed in 6.28 seconds.
    0 Warning(s)
    0 Error(s)
Build ended
GL_VERSION: 2.1 INTEL-10.14.58
GL_VENDOR: Intel Inc.
GL_RENDERER: Intel Iris Pro OpenGL Engine
libc++abi.dylib: terminating with uncaught exception of type Xli::Exception: Xli::Exception
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) object.wrapper_native_0x29e52b0 (intptr,string,intptr,int,Uno.Native.Textures.TextureInfo&) <IL 0x0003c, 0xffffffff>
  at Uno.Native.Textures.Texture..ctor (string,byte[]) <IL 0x00032, 0x000b3>
  at Uno.Native.Textures.Texture..ctor (string,System.IO.Stream) <IL 0x00008, 0x0002b>
  at Experimental.TextureLoader.CilTextureLoader.LoadTexture (Uno.Buffer,System.Action`1<Uno.Graphics.Texture2D>,string) <IL 0x00026, 0x00163>
  at Experimental.TextureLoader.TextureLoaderImpl.PngByteArrayToTexture2D (Uno.Buffer,Experimental.TextureLoader.Callback) <IL 0x0000c, 0x00027>
  at Experimental.TextureLoader.TextureLoader.PngByteArrayToTexture2D (Uno.Buffer,System.Action`1<Uno.Graphics.Texture2D>) <IL 0x00002, 0x0006b>
  at Experimental.TextureLoader.TextureLoader.ByteArrayToTexture2DFilename (Uno.Buffer,string,System.Action`1<Uno.Graphics.Texture2D>) <IL 0x0001a, 0x0003f>
  at Fuse.Resources.FileImageSourceImpl.SyncLoad () <IL 0x0003c, 0x000e3>
  at Fuse.Resources.FileImageSource.set_File (Uno.UX.FileSource) <IL 0x00030, 0x0004f>
  at Fuse.Internal.ImageContainer.OnFileAdded (Uno.UX.FileSource) <IL 0x00028, 0x0008b>
  at Uno.Collections.ObservableList`1.Add (T) <IL 0x0002f, 0x000c9>
  at Fuse.Internal.ImageContainer.set_File (Uno.UX.FileSource) <IL 0x00064, 0x00087>
  at Fuse.Controls.Image.set_File (Uno.UX.FileSource) <IL 0x00007, 0x0001f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00062, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <IL 0x00038, 0xffffffff>
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <IL 0x0005a, 0x000b7>
  at System.Reflection.MethodBase.Invoke (object,object[]) <IL 0x00006, 0x00039>
  at Outracks.Simulator.Runtime.TryInvokeExtension/<TryInvoke>c__AnonStorey0.<>m__0 () [0x00000] in /Users/outracks/buildAgent1/work/b939dc4c6ac331f9/Source/Outracks.Simulator.Runtime/Reflection/CompiledTypeReflection.cs:275
  at Outracks.Simulator.Runtime.TryInvokeExtension.Try (System.Func`1<object>) [0x00000] in /Users/outracks/buildAgent1/work/b939dc4c6ac331f9/Source/Outracks.Simulator.Runtime/Reflection/CompiledTypeReflection.cs:282
  at Outracks.Simulator.Runtime.TryInvokeExtension.TryInvoke (System.Reflection.MethodInfo,object,object[]) [0x0001b] in /Users/outracks/buildAgent1/work/b939dc4c6ac331f9/Source/Outracks.Simulator.Runtime/Reflection/CompiledTypeReflection.cs:275
  at Outracks.Simulator.Runtime.CompiledTypeReflection.SetPropertyValue (object,Outracks.Simulator.Bytecode.TypeMemberName,object) [0x00032] in /Users/outracks/buildAgent1/work/b939dc4c6ac331f9/Source/Outracks.Simulator.Runtime/Reflection/CompiledTypeReflection.cs:57
  at Outracks.Fuse.Preview.RuntimeObjectPoker.<HookUpReflectionInterface>m__2 (object,string,object) [0x00000] in /Users/outracks/buildAgent1/work/b939dc4c6ac331f9/Source/Outracks.Fuse.Preview/RuntimeObjectPoker.cs:29
  at Outracks.Simulator.Reflection.DelegateReflection.Outracks.Simulator.Runtime.IReflection.SetPropertyValue (object,Outracks.Simulator.Bytecode.TypeMemberName,object) <IL 0x0000e, 0x0002c>
  at Outracks.Simulator.Runtime.ScopeClosure.Evaluate (Outracks.Simulator.Bytecode.WriteProperty) <IL 0x00024, 0x00065>
  at Outracks.Simulator.Bytecode.Expression.Match<T> (System.Func`2<Outracks.Simulator.Bytecode.ReadVariable, T>,System.Func`2<Outracks.Simulator.Bytecode.Literal, T>,System.Func`2<Outracks.Simulator.Bytecode.Lambda, T>,System.Func`2<Outracks.Simulator.Bytecode.MethodGroup, T>,System.Func`2<Outracks.Simulator.Bytecode.IsType, T>,System.Func`2<Outracks.Simulator.Bytecode.LogicalOr, T>,System.Func`2<Outracks.Simulator.Bytecode.Instantiate, T>,System.Func`2<Outracks.Simulator.Bytecode.CallLambda, T>,System.Func`2<Outracks.Simulator.Bytecode.CallStaticMethod, T>,System.Func`2<Outracks.Simulator.Bytecode.CallDynamicMethod, T>,System.Func`2<Outracks.Simulator.Bytecode.ReadStaticField, T>,System.Func`2<Outracks.Simulator.Bytecode.ReadProperty, T>,System.Func`2<Outracks.Simulator.Bytecode.WriteProperty, T>,System.Func`2<Outracks.Simulator.Bytecode.AddEventHandler, T>,System.Func`2<Outracks.Simulator.Bytecode.RemoveEventHandler, T>) <IL 0x0019d, 0x003d8>
  at Outracks.Simulator.Runtime.ScopeClosure.Evaluate (Outracks.Simulator.Bytecode.Expression) <IL 0x000c4, 0x00453>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (System.Collections.Generic.IEnumerable`1<Outracks.Simulator.Bytecode.Statement>) <IL 0x0002a, 0x00077>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (Outracks.Simulator.Bytecode.Lambda,object[]) <IL 0x00077, 0x00157>
  at Outracks.Simulator.Runtime.LambdaClosure.Func (object) <IL 0x00016, 0x00064>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (object,object[]) <IL 0x0003b, 0x000e2>
  at Outracks.Simulator.Runtime.ScopeClosure.Evaluate (Outracks.Simulator.Bytecode.CallLambda) <IL 0x00019, 0x0004f>
  at Outracks.Simulator.Bytecode.Expression.Match<T> (System.Func`2<Outracks.Simulator.Bytecode.ReadVariable, T>,System.Func`2<Outracks.Simulator.Bytecode.Literal, T>,System.Func`2<Outracks.Simulator.Bytecode.Lambda, T>,System.Func`2<Outracks.Simulator.Bytecode.MethodGroup, T>,System.Func`2<Outracks.Simulator.Bytecode.IsType, T>,System.Func`2<Outracks.Simulator.Bytecode.LogicalOr, T>,System.Func`2<Outracks.Simulator.Bytecode.Instantiate, T>,System.Func`2<Outracks.Simulator.Bytecode.CallLambda, T>,System.Func`2<Outracks.Simulator.Bytecode.CallStaticMethod, T>,System.Func`2<Outracks.Simulator.Bytecode.CallDynamicMethod, T>,System.Func`2<Outracks.Simulator.Bytecode.ReadStaticField, T>,System.Func`2<Outracks.Simulator.Bytecode.ReadProperty, T>,System.Func`2<Outracks.Simulator.Bytecode.WriteProperty, T>,System.Func`2<Outracks.Simulator.Bytecode.AddEventHandler, T>,System.Func`2<Outracks.Simulator.Bytecode.RemoveEventHandler, T>) <IL 0x000f8, 0x00261>
  at Outracks.Simulator.Runtime.ScopeClosure.Evaluate (Outracks.Simulator.Bytecode.Expression) <IL 0x000c4, 0x00453>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (System.Collections.Generic.IEnumerable`1<Outracks.Simulator.Bytecode.Statement>) <IL 0x0002a, 0x00077>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (Outracks.Simulator.Bytecode.Lambda,object[]) <IL 0x00077, 0x00157>
  at Outracks.Simulator.Runtime.LambdaClosure.Func (object) <IL 0x00016, 0x00064>
  at Outracks.Simulator.Runtime.LambdaClosure.Action (object) <IL 0x00002, 0x0001b>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (object,object[]) <IL 0x000ce, 0x002e5>
  at Outracks.Simulator.Runtime.ScopeClosure.Evaluate (Outracks.Simulator.Bytecode.CallLambda) <IL 0x00019, 0x0004f>
  at Outracks.Simulator.Bytecode.Expression.Match<T> (System.Func`2<Outracks.Simulator.Bytecode.ReadVariable, T>,System.Func`2<Outracks.Simulator.Bytecode.Literal, T>,System.Func`2<Outracks.Simulator.Bytecode.Lambda, T>,System.Func`2<Outracks.Simulator.Bytecode.MethodGroup, T>,System.Func`2<Outracks.Simulator.Bytecode.IsType, T>,System.Func`2<Outracks.Simulator.Bytecode.LogicalOr, T>,System.Func`2<Outracks.Simulator.Bytecode.Instantiate, T>,System.Func`2<Outracks.Simulator.Bytecode.CallLambda, T>,System.Func`2<Outracks.Simulator.Bytecode.CallStaticMethod, T>,System.Func`2<Outracks.Simulator.Bytecode.CallDynamicMethod, T>,System.Func`2<Outracks.Simulator.Bytecode.ReadStaticField, T>,System.Func`2<Outracks.Simulator.Bytecode.ReadProperty, T>,System.Func`2<Outracks.Simulator.Bytecode.WriteProperty, T>,System.Func`2<Outracks.Simulator.Bytecode.AddEventHandler, T>,System.Func`2<Outracks.Simulator.Bytecode.RemoveEventHandler, T>) <IL 0x000f8, 0x00261>
  at Outracks.Simulator.Runtime.ScopeClosure.Evaluate (Outracks.Simulator.Bytecode.Expression) <IL 0x000c4, 0x00453>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (System.Collections.Generic.IEnumerable`1<Outracks.Simulator.Bytecode.Statement>) <IL 0x0002a, 0x00077>
  at Outracks.Simulator.Runtime.ScopeClosure.Execute (Outracks.Simulator.Bytecode.Lambda,object[]) <IL 0x00077, 0x00157>
  at Outracks.Simulator.Runtime.VirtualMachine.Execute (Outracks.Simulator.Runtime.IReflection,Outracks.Simulator.Bytecode.Lambda,object[]) <IL 0x00017, 0x000af>
  at Outracks.Simulator.Runtime.VirtualMachine.Execute (Outracks.Simulator.Bytecode.Lambda,object[]) <IL 0x00007, 0x00023>
  at Outracks.Simulator.Reifying.OnEnterState () <IL 0x00037, 0x000b7>
  at Outracks.Simulator.Application.SetState (Outracks.Simulator.State) <IL 0x0002c, 0x00052>
  at Outracks.Simulator.Application.OnUpdate () <IL 0x00037, 0x00073>
  at Fuse.App.Update () <IL 0x0002a, 0x0004e>
  at Uno.Runtime.Implementation.Internal.Bootstrapper.OnUpdate () [0x00016] in /Users/outracks/buildAgent1/work/397767071b813b09/Source/Runtime/Uno.Runtime.Core/Uno/Runtime/Implementation/Internal/Bootstrapper.cs:40
  at Outracks.Fusion.Native.UnoCoreInterop.UnoBootstrapper.OnUpdate () [0x00000] in /Users/outracks/buildAgent1/work/b939dc4c6ac331f9/Source/Outracks.Fusion.Native.UnoCoreInterop/UnoBootstrapper.cs:93
  a

Hi, there seems to be an issue in our image loading code. I’ll file an issue internally to get it looked at, and try to find a workaround for you in the mean time.

It looks like there was something in Flower.png that our texture loader was unable to read. I opened and saved the image in Gimp, and now it works. You can use this file until I’ve investigated the issue more thorougly:

Found it, that image was actually a jpeg, but with a png extension. Still, Fuse shouldn’t have crashed, we’ll make sure to improve this.

Got it,thank you.

Thanks a lot for the reproduction case. We have come up with a fix, and will try to get that included in the upcoming 0.20-release.

Hi, i’m having this same issue but it fails only on the iOS device (preview and build), local preview works ok. Thing is, my app is full of images and i don’t know which one is the one with the problem. Is there a way to debug on xcode to check what image is causing the exception?

Xcode stops in TextureLoader class, method PngByteArrayToTexture2D, and before that in the stack call is method ByteArrayToTexture2DFilename, where a filename variable is, but i can’t inspect its value.

I’m using Fuse 0.24

Thanks in advance

You should be able to debug just like a normal xcode project. I would make a small test project that cycle through the pictures and prints out the Uri.