UABEA
UABEA copied to clipboard
Crash while batch import
Making a texture overhaul for Valheim,, tried to batch import textures from png, the program crash to desktop.
https://github.com/nesrak1/UABEA/wiki/Sending-a-crashlog
Application: UABEAvalonia.exe
CoreCLR Version: 5.0.1221.52207
.NET Version: 5.0.12
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException: Parameter "width" (System.Int32) must be greater than 0, was 0 (Parameter 'width')
at SixLabors.ThrowHelper.ThrowArgumentOutOfRangeException(String name, String message)
at SixLabors.ThrowHelper.ThrowArgumentOutOfRangeExceptionForMustBeGreaterThan[T](T value, T minimum, String name)
at SixLabors.ImageSharp.ImageFrame1..ctor(Configuration configuration, Int32 width, Int32 height, MemoryGroup
1 memorySource, ImageFrameMetadata metadata)
at SixLabors.ImageSharp.ImageFrame1..ctor(Configuration configuration, Int32 width, Int32 height, MemoryGroup
1 memorySource)
at SixLabors.ImageSharp.ImageFrameCollection1..ctor(Image
1 parent, Int32 width, Int32 height, MemoryGroup1 memorySource) at SixLabors.ImageSharp.Image
1..ctor(Configuration configuration, MemoryGroup1 memoryGroup, Int32 width, Int32 height, ImageMetadata metadata) at SixLabors.ImageSharp.Image.CreateUninitialized[TPixel](Configuration configuration, Int32 width, Int32 height, ImageMetadata metadata) at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.InitializeImage[TPixel](ImageMetadata metadata, Image
1& image)
at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.Decode[TPixel](BufferedReadStream stream, CancellationToken cancellationToken)
at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel](IImageDecoderInternals decoder, Configuration configuration, Stream stream, Func3 largeImageExceptionFactory) at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel](IImageDecoderInternals decoder, Configuration configuration, Stream stream) at SixLabors.ImageSharp.Formats.Png.PngDecoder.Decode[TPixel](Configuration configuration, Stream stream) at SixLabors.ImageSharp.Image.Decode[TPixel](Stream stream, Configuration config) at SixLabors.ImageSharp.Image.<>c__DisplayClass133_0
1.<Load>b__0(Stream s)
at SixLabors.ImageSharp.Image.WithSeekableStream[T](Configuration configuration, Stream stream, Func2 action) at SixLabors.ImageSharp.Image.Load[TPixel](Configuration configuration, Stream stream, IImageFormat& format) at SixLabors.ImageSharp.Image.Load[TPixel](Configuration configuration, Stream stream) at SixLabors.ImageSharp.Image.Load[TPixel](Configuration configuration, String path) at SixLabors.ImageSharp.Image.Load[TPixel](String path) at TexturePlugin.TextureImportExport.ImportPng(String file, TextureFormat format, Int32& width, Int32& height) at TexturePlugin.ImportTextureOption.ImportTextures(Window win, List
1 batchInfos)
at TexturePlugin.ImportTextureOption.ExecutePlugin(Window win, AssetWorkspace workspace, List1 selection) at UABEAvalonia.PluginWindow.BtnOk_Click(Object sender, RoutedEventArgs e) in D:\a\UABEA\UABEA\UABEAvalonia\PluginWindow.axaml.cs:line 59 at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state) at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass5_0.<Post>b__0() in /_/src/Avalonia.Base/Threading/AvaloniaSynchronizationContext.cs:line 33 at Avalonia.Threading.JobRunner.RunJobs(Nullable
1 priority) in //src/Avalonia.Base/Threading/JobRunner.cs:line 37
at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in //src/Windows/Avalonia.Win32/Win32Platform.cs:line 210
at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in //src/Windows/Avalonia.Win32/Win32Platform.cs:line 157
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in //src/Avalonia.Base/Threading/Dispatcher.cs:line 61
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in //src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 107
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in //src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 134
at UABEAvalonia.Program.Main(String[] args) in D:\a\UABEA\UABEA\UABEAvalonia\Program.cs:line 47
Should be an easy fix. There are some textures (usually called Font Texture) which are 0x0 size and ImageSharp doesn't like 0x0 images. I fixed this in the batch export, but apparently forgot it in the batch import.
Thank you
I take back what I said, I don't even know how you got a 0x0 png (I can't even make one to reproduce this bug...) Is it possible you have a png somewhere that starts with Font Texture
? Is it possible you maybe exported this with an earlier version of UABEA or a different tool? It's supposed to not export textures that are 0x0 sized.
Do not worry, yes these textures are font textures! They are were exported with UABE from Valheim asset files. Will try again in a few hours to remove them from the folder an try again.
OK, I removed all font files. The import job is a about 1200 png textures with mixed compression method (defaults of valheim game), RGBA32 / DXT1 / DXT5 / BC7 and various sizeis from 8192x8192 to 64x64.
What i do is to arrange by type, then select all texture2d and then batch import.
Importing started and finished Although UAEBA isusing 1 cpu core was faster than UABE using all cores. IT created a "unity default resources" which does not exist either in the game and does not get created by UABE
The bad thing is that i tested the output files and Valheim CTD on loading reporting unity error.
To get an idea, this is my project https://www.nexusmods.com/valheim/mods/1620
PS. Search do not seem to work for me when i arrange by type. It only works when you leave the arrangement default. When i arrange by type and search, it high lights the row that the asset was when is was not arranged. Sorry for my English and bad description, English is not my native language... I suspect that this might be the reason for bad export i mentioned above.
IT created a "unity default resources" which does not exist either in the game and does not get created by UABE
This is a bug but not really an issue. It should have been put in the Resources folder, but that file shouldn't usually be edited anyway.
The bad thing is that i tested the output files and Valheim CTD on loading reporting unity error.
Is this with all textures or just one? Could you maybe narrow it down to importing which texture causes the error?
PS. Search do not seem to work for me when i arrange by type. It only works when you leave the arrangement default. When i arrange by type and search, it high lights the row that the asset was when is was not arranged.
Sadly this is probably an Avalonia bug (UI library) and I've put out a bug report but haven't heard anything back.
Sorry for being late, well it is to difficult to narrow it down. I have 1300 textures spread to 5 asset files...
Looks like this is related to #49 except it wasn't fixed for batch import. Let me know if it works now.
Closing since this issue is pretty old. Apparently I fixed it a while ago.