System.FormatException on media file URLs

We noticed a large number of System.FormatException errors in log viewer for media files.

We suspect that issue might be related to caching since the error doesn’t happen all the time even when loading the same media files that are throwing the errors.

Does anyone else experience this and is there something we can do to resolve/ prevent the error.

Thanks for your help,
Stefanie.

System.FormatException: The input string ‘1200&quality=80&v=1d7f18bd2a58510’ was not in a correct format.
at System.Number.ThrowFormatException[TChar](ReadOnlySpan1 value) at System.Convert.ToDecimal(String value, IFormatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at SixLabors.ImageSharp.Web.Commands.Converters.IntegralNumberConverter1.ConvertFrom(CommandParser parser, CultureInfo culture, String value, Type propertyType)
at Umbraco.Cms.Imaging.ImageSharp.ConfigureImageSharpMiddlewareOptions.b__3_0(ImageCommandContext context)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
at Umbraco.Commerce.Cms.Web.Mvc.UmbracoCommerceRequestBufferingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at Umbraco.Forms.Web.HttpModules.ProtectFormUploadRequestsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/115281-systemformatexception-on-media-file-urls