SiliconStudio / xenko

Old repo for Xenko Game Engine. Please use https://github.com/xenko3d/xenko instead.
http://xenko.com
1.54k stars 345 forks source link

Image.Load keeps returning NotSupportedException on Linux #551

Open Maxdg95 opened 7 years ago

Maxdg95 commented 7 years ago

I'm trying to load images from a directory besides executable found by using the VirtualFileSystem. However it keeps returning NotSupportedException on Linux, on windows its all fine.

How I load the Image in:

using(Stream stream = File.Open(comURI*, FileMode.Open)) { using (var br = new BinaryReader(stream)) textPack.toggles.Add(Image.Load(stream); }

this does return NotSupportedException, I've checked the images(png originally) and ported them over to jpg. doesn't work either. Changing way of importing:

Full Stacktrace:

Unhandled Exception: System.NotSupportedException: Image format not supported at SiliconStudio.Xenko.Graphics.Image.Load (System.IntPtr dataPointer, System.Int32 dataSize, System.Boolean makeACopy, System.Nullable`1[T] handle, System.Boolean loadAsSRGB) [0x0006c] in :0 at SiliconStudio.Xenko.Graphics.Image.Load (System.Byte[] buffer, System.Boolean loadAsSRGB) [0x00031] in :0 at SiliconStudio.Xenko.Graphics.Image.Load (System.IO.Stream imageStream, System.Boolean loadAsSRGB) [0x00014] in :0 at SiliconStudio.Xenko.Graphics.Texture.Load (SiliconStudio.Xenko.Graphics.GraphicsDevice device, System.IO.Stream stream, SiliconStudio.Xenko.Graphics.TextureFlags textureFlags, SiliconStudio.Xenko.Graphics.GraphicsResourceUsage usage, System.Boolean loadAsSRGB) [0x00000] in :0 at GamingSupport.Games.KenoGame.GetAllTexturePacks (SiliconStudio.Xenko.Graphics.GraphicsDevice device) [0x000ef] in <8f467787f8a64132a7a07fcc350b74c0>:0 at Keno.Testing.Start () [0x0004b] in :0 at SiliconStudio.Core.MicroThreading.Scheduler.Run () [0x00286] in :0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0 at SiliconStudio.Xenko.Engine.Processors.ScriptSystem.HandleSynchronousException (SiliconStudio.Xenko.Engine.ScriptComponent script, System.Exception e) [0x00024] in <6ce1d9b0212c4140b4a1913e1d68c191>:0 at SiliconStudio.Xenko.Engine.Processors.ScriptSystem.Scheduler_ActionException (SiliconStudio.Core.MicroThreading.Scheduler scheduler, SiliconStudio.Core.MicroThreading.SchedulerEntry schedulerEntry, System.Exception e) [0x00000] in <6ce1d9b0212c4140b4a1913e1d68c191>:0 at SiliconStudio.Core.MicroThreading.Scheduler.Run () [0x002a2] in :0 at SiliconStudio.Xenko.Engine.Processors.ScriptSystem.Update (SiliconStudio.Xenko.Games.GameTime gameTime) [0x00111] in <6ce1d9b0212c4140b4a1913e1d68c191>:0 at SiliconStudio.Xenko.Games.GameSystemCollection.Update (SiliconStudio.Xenko.Games.GameTime gameTime) [0x00090] in <0e6fe160ad004c7aaa86dbc881811e4e>:0 at SiliconStudio.Xenko.Games.GameBase.Update (SiliconStudio.Xenko.Games.GameTime gameTime) [0x00006] in <0e6fe160ad004c7aaa86dbc881811e4e>:0 at SiliconStudio.Xenko.Games.GameBase.InitializeBeforeRun () [0x000b9] in <0e6fe160ad004c7aaa86dbc881811e4e>:0

manu-st commented 7 years ago

Thanks for the report. We are looking into this as this part hasn't been implemented yet for Linux.

Maxdg95 commented 7 years ago

Shoot! Will it be implemented with the release in April or do I need to look for a workaround?

manu-st commented 7 years ago

Not sure yet. Could you add those files in GameStudio instead of loading them at runtime?

Maxdg95 commented 7 years ago

Actually i can't. I'm working towards a texture packing system to allow the user to grab the texture packs from a folder adjacent to the executable so loading at runtime is essential.