PiranhaCMS / piranha.core

Piranha CMS is the friendly editor-focused CMS for .NET that can be used both as an integrated CMS or as a headless API.

Home Page:http://piranhacms.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webp images are being processed and come out 10x larger

thomas-gregg-bz-agency opened this issue · comments

public void AutoOrient(Stream source, Stream dest)

As per the title when we upload an image in webp format, the resulting image comes out roughly 10 times bigger. We have not seen this for other image formats

Could you try asking the same question at the https://github.com/SixLabors/ImageSharp repo as we have no control over what happens inside the actual image processing. The current version of Piranha uses the latest released version of ImageSharp (2.1.3) but maybe there is a bug on their side related to this.

If you open an issue there, please reference this issue and make sure to include the code that seems to do the faulty processing, i.e:

using (var image = Image.Load(source, out IImageFormat format))
{
    image.Mutate(x => x.AutoOrient());
    image.Save(dest, format);
}

A workaround would be to remove the default registration in App.MediaTypes.Images and add it back with image processing disable with

App.MediaTypes.Images.Add(".webp", "image/webp", false);

@tidyui I have raised an issue over at ImageSharp and they have referenced a couple of other issues that seem to resolve the issue. Is there something that needs to be done like defining the encoding configuration?