Issues generating thumbnail images in cms 12

Vote:
 

Hi Folks,

We are currently upgrading a site to cms 12 and are experiencing issues when generating thumbnails in the cms.  Thumbnails are generated as a 1x1 pixel image.  The class we are using for images is inheriting from the ImageData class and using the standard Thumbnail property  

We have tried overirding this and setting Pregenerated to false.  This gives us the following 500 error when trying to retrieve a thumbnail.

Has anyone experienced these issues before?

Many thanks,

Dave

#305729
Edited, Jul 26, 2023 10:50
Vote:
 

A shot in the dark but it sounds like Imagesharp is interfering with Thumbnail generation. Can you disable it and retry?

#305731
Jul 26, 2023 13:30
Vote:
 

You're in the right ballpark. Looks to be a breaking change in Imagesharp 3. From Optimizely

 'I think you may have to downgrade SixLabors.ImageSharp to version 2.0 as there's a breaking change in its version 3.x that breaks the CMS internal resizing function.
 
The reason is, two encoder classes SixLabors.ImageSharp.Formats.Jpeg.JpegEncoder and SixLabors.ImageSharp.Formats.Png.PngEncoder has changed in SixLabors.ImageSharp 3.x. For example: JpegEncoder.Quality field is no longer having its set method when our CMS internal code of IImageService is using that set method, which exists in ImageSharp 2.0.'

Downgraded to the last release of v2.x and it seems to have worked.

#305732
Jul 26, 2023 13:33
Vote:
 

Since one of our other dependencies required ImageSharp 3.x, I ended up copying the code from DefaultImageService.cs (Episerver.ImageLibrary.dll) into my project and used that instead. It just required a recompile, no code changes, against ImageSharp 3. 

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<IImageService, ImageService>();
}

Here was the response from Optimizely Support:

"Right now, we have yet had any plan to upgrade that in the near future due to numerous of breaking changes of ImageSharp v3. Forcing the installation of ImageSharp 3 breaks some functionalities of assets management in CMS edit mode."

Edit: ImageSharp dependency will be removed in an upcoming version of Episerver.Cms, hopefully next week.

#306025
Edited, Aug 01, 2023 4:03
Vote:
 

Verifying a site on Integration where I'm now running 12.17.0 of EPiServer.Hosting with these:

<PackageReference Include="EPiServer.ImageLibrary.ImageSharp" Version="2.0.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />

Site has some custom ImageSharp code as well and all seems to be working fine...

https://world.optimizely.com/blogs/son-d--nguyen/dates/2023/8/a-note-on-cms-core-12-17-0-upgrade/

#307299
Aug 22, 2023 14:59
* 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.