Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

EPiServer.CMS.Core 12.4.2 breaks ImageSharp

Vote:
 

SixLabors has not updated ImageSharp.Web to work with ImageSharp 2.0 yet. The latest version of ImageSharp.Web is 1.0.5.

EPiServer.CMS.Core 12.4.2, however, made ImageSharp 2.0 a dependency. Which means that ImageSharp is currently broken.

Which means that we can no longer do this:

/globalassets/media/my-image.jpg?width=320

It barfs with the following exception, and to my knowledge there is no workaround.

System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task`1<SixLabors.ImageSharp.Formats.IImageFormat> SixLabors.ImageSharp.Image.DetectFormatAsync(SixLabors.ImageSharp.Configuration, System.IO.Stream)'.
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.<>c__DisplayClass19_0.<<ProcessRequestAsync>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.<>c__DisplayClass19_0.<ProcessRequestAsync>b__0(String key)
   at SixLabors.ImageSharp.Web.Middleware.ConcurrentDictionaryExtensions.GetOrAddAsync[TKey,TValue](ConcurrentDictionary`2 dictionary, TKey key, Func`2 valueFactory)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(HttpContext context, IImageResolver sourceImageResolver, ImageContext imageContext, IDictionary`2 commands)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

This is discussed at Vincent Baaij's GitHub repo here:

https://github.com/vnbaaij/Baaijte.Optimizely.ImageSharp.Web/issues/8

There are also a number of discussions here on World:

https://world.optimizely.com/Search?sectionFilter=&searchQuery=imagesharp

Opti CMS Team: Can we rollback/undo the SixLabors.ImageSharp >=2.0 requirement until the CMS is ready to update to .NET 6? (pretty please)

#277965
Apr 06, 2022 20:06
Vote:
 

Thanks for raising this Drew. I just wanted to flag that this is also an issue for us and we are very keen to find a solution. 

#278008
Edited, Apr 07, 2022 1:34
Vote:
 

I will forward this to CMS Core team - thanks for bringing this into our attention

#278326
Apr 11, 2022 13:49
Vote:
 

We're sorry for the inconvenience, but we can't always consider all third-party dependencies you might have. We're trying to be as considerate as possible and have as wide dependency ranges as possible. In this case it's probably best to wait and update until SixLabors.ImageSharp.Web 2.0 has been released. The release seems imminent https://github.com/SixLabors/ImageSharp.Web/discussions/223.

Not sure what this has to do with .NET6? CMS is cross-compiled for .NET5 and .NET6, some auxillary packages hasn't been cross-compiled yet, but you should still be able to run .NET6. You could run .NET6 before we cross-compiled as well, but you had to explicitly update a lot of packags to get it to work. Now that's not necessary.

#278369
Apr 12, 2022 8:10
Vote:
 

Thanks for the direct reply Johan. You are right, I got that confused: SixLabors.ImageSharp is a dependency for EPiServer.CMS.Core, but SixLabors.ImageSharp.Web is not. 🤦‍♂️

I imagine ImageSharp.Web is widely used for dynamic image processing with Opti CMS. I'm not even sure what else is available, unless you're working with a 3P DAM that can do it. I'll keep an eye on that GitHub thread.

Thanks for the tip on .NET6, I didn't realize we were already into official support--

https://world.optimizely.com/blogs/Magnus-Rahl/Dates/2022/2/rolling-out-support-for--net-6

👏👏👏

#278418
Apr 13, 2022 4:04
Vote:
 

fyi, I just uploaded V2.0.0 of my Baaijte.Optimizely.ImageSharp.Web package. This (only) works  with .NET 6, CMS 12.5.0+ ImageSharp 2+ and ImageSharp.Web 2+

#279011
Apr 22, 2022 15:48
Vote:
 

fyi, I just uploaded V2.0.0 of my Baaijte.Optimizely.ImageSharp.Web package. This (only) works  with .NET 6, CMS 12.5.0+ ImageSharp 2+ and ImageSharp.Web 2+

#279012
Apr 22, 2022 15:48
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.