error : Bit depth is not supported or not valid.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
nopcommerce : 4.3 on centOs 8
MSSQL on Centos 8
libgdiplus -inslalled
Net.Core 3.1

товары из имеющейся базы , которые в виндовсе ошибок не выдают , при работе в линуксе выдают ошибку, ошибка возникает при нажатии на отдельные товары.

error: Bit depth is not supported or not valid.

System.NotSupportedException: Bit depth is not supported or not valid.
   at SixLabors.ImageSharp.Formats.Png.PngEncoderOptionsHelpers.CalculateBitDepth[TPixel](PngEncoderOptions options, Image`1 image, IndexedImageFrame`1 quantizedFrame)
   at SixLabors.ImageSharp.Formats.Png.PngEncoderCore.Encode[TPixel](Image`1 image, Stream stream)
   at SixLabors.ImageSharp.Formats.Png.PngEncoder.Encode[TPixel](Image`1 image, Stream stream)
   at Nop.Services.Media.PictureService.EncodeImage[TPixel](Image`1 image, IImageFormat imageFormat, Nullable`1 quality) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Media\PictureService.cs:line 405
3 years ago
In PictureService.cs
Under EncodeImage
Change
case PngEncoder pngEncoder:
                        pngEncoder.ColorType = PngColorType.RgbWithAlpha;
                        pngEncoder.Encode(image, stream);
                        break;
To
case PngEncoder pngEncoder:
                        pngEncoder.ColorType = PngColorType.RgbWithAlpha;
                        pngEncoder.BitDepth = PngBitDepth.Bit8;
                        pngEncoder.Encode(image, stream);
                        break;
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.