advanced-cms / advanced-reviews

This is an Open Source add-on that improves the reviewing process and lets external users to view & review content items or whole projects without the need to access the Edit Mode. Created and maintained by Bartosz Sekuła and Grzegorz Wiecheć
Apache License 2.0
17 stars 15 forks source link

Avatar image not generated on Linux DXP #253

Open andrewmarkham opened 2 months ago

andrewmarkham commented 2 months ago

The Avatar images are not generated when the site is hosted on a Linux DXP instance.

image

The following error is generated

2024-09-20T09:54:55.3716948Z    [10:54:55 ERR] An unhandled exception has occurred while executing the request.
2024-09-20T09:54:55.3717286Z    System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
2024-09-20T09:54:55.3724985Z     ---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information.
2024-09-20T09:54:55.372525Z    at System.Drawing.LibraryResolver.EnsureRegistered()
2024-09-20T09:54:55.3725339Z       at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
2024-09-20T09:54:55.3733948Z       at System.Drawing.SafeNativeMethods.Gdip..cctor()
2024-09-20T09:54:55.373418Z    --- End of inner exception stack trace ---
2024-09-20T09:54:55.3734278Z       at System.Drawing.SafeNativeMethods.Gdip.GdipCreatePath(FillMode brushMode, IntPtr& path)
2024-09-20T09:54:55.373438Z    at System.Drawing.Drawing2D.GraphicsPath..ctor()
2024-09-20T09:54:55.3742548Z       at Advanced.CMS.ApprovalReviews.IdenticonGenerator.Initialize()
2024-09-20T09:54:55.3742767Z       at Advanced.CMS.ApprovalReviews.IdenticonGenerator..ctor()
2024-09-20T09:54:55.3742863Z       at Advanced.CMS.ApprovalReviews.AvatarsService.ReviewAvatarsController..ctor(ICustomAvatarResolver customAvatarResolver)
2024-09-20T09:54:55.3742975Z       at lambda_method10482(Closure, IServiceProvider, Object[])
2024-09-20T09:54:55.3751001Z       at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
2024-09-20T09:54:55.3757502Z       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2024-09-20T09:54:55.3757799Z       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
2024-09-20T09:54:55.3757891Z    --- End of stack trace from previous location ---
2024-09-20T09:54:55.377372Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2024-09-20T09:54:55.3773967Z       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
2024-09-20T09:54:55.3774065Z       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2024-09-20T09:54:55.3774162Z       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
2024-09-20T09:54:55.3774396Z    --- End of stack trace from previous location ---
2024-09-20T09:54:55.3774496Z       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
2024-09-20T09:54:55.3774599Z       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
2024-09-20T09:54:55.3774697Z       at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
2024-09-20T09:54:55.3774805Z       at Mediachase.Commerce.Anonymous.Internal.AnonymousIdMiddleware.Invoke(HttpContext httpContext)
2024-09-20T09:54:55.3774894Z       at Geta.NotFoundHandler.Infrastructure.Initialization.NotFoundHandlerMiddleware.InvokeAsync(HttpContext context, RequestHandler requestHandler)
2024-09-20T09:54:55.3774979Z       at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
2024-09-20T09:54:55.3775066Z       at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
2024-09-20T09:54:55.3775173Z       at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
2024-09-20T09:54:55.377526Z    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
2024-09-20T09:54:55.3775353Z       at Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware.InvokeInternal(HttpContext context, HttpLoggingOptions options, HttpLoggingAttribute loggingAttribute, HttpLoggingFields loggingFields)
2024-09-20T09:54:55.3775457Z       at Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware.InvokeInternal(HttpContext context, HttpLoggingOptions options, HttpLoggingAttribute loggingAttribute, HttpLoggingFields loggingFields)
2024-09-20T09:54:55.3775541Z       at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
2024-09-20T09:54:55.3775623Z       at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
2024-09-20T09:54:55.3789341Z    [10:54:55 INF] Request:

It is possible to create a custom ICustomAvatarResolver and that's maybe something I will look to do, but I felt it's worth raising the defect.

barteksekula commented 3 weeks ago

Yes, it should be possible but I will need to check. Will get back to you on this one,