Quackster / Avatara

Habbo Hotel figure avatar imager for 2009 era figure codes written in C# .NET 8
GNU General Public License v3.0
5 stars 6 forks source link

Error when passing query string "size=l" #3

Closed Alex-Habbz closed 3 weeks ago

Alex-Habbz commented 1 month ago

Getting following error below when using Minerva and passing query string "size=l" which should display large avatar. Can only get small and medium size avatar to work.

Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.ObjectDisposedException: Cannot access a disposed object.
      Object name: 'Image`1'.
         at SixLabors.ImageSharp.Image.ThrowObjectDisposedException(Type type)
         at SixLabors.ImageSharp.Image.Save(Stream stream, IImageEncoder encoder)
         at Avatara.Avatar.RenderImage(Image`1 croppedBitmap)
         at Avatara.Avatar.DrawImage(List`1 buildQueue)
         at Avatara.Avatar.Run()
         at Minerva.Controllers.FigureController.Index() in /home/pi/Minerva/Controllers/FigureController.cs:line 124
         at lambda_method1(Closure, Object, Object[])
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Quackster commented 1 month ago

The issue can be reproduced. I will look into it soon.

Quackster commented 3 weeks ago

Fixed. https://github.com/Quackster/Avatara/commit/7aeb51c2881f5f60f3dc54f0e16ee12349464201