Orchardcore: Exception on image resize on x64

Created on 13 Jun 2020  路  12Comments  路  Source: OrchardCMS/OrchardCore

Hi,

I get an exception when an image from media is resized with querystring parameters. This exception is in the logging.

2020-06-13 14:06:17.364 +02:00 [ERR] The image 'https://.../media/digid.png?width=100&height=100' could not be processed
System.PlatformNotSupportedException: Operation is not supported on this platform.
   at System.Runtime.Intrinsics.X86.Ssse3.MultiplyAddAdjacent(Vector128`1 left, Vector128`1 right)
   at SixLabors.ImageSharp.Formats.Png.PngEncoderCore.EncodePixels[TPixel](Image`1 pixels, IndexedImageFrame`1 quantized, ZlibDeflateStream deflateStream)
   at SixLabors.ImageSharp.Formats.Png.PngEncoderCore.WriteDataChunks[TPixel](Image`1 pixels, IndexedImageFrame`1 quantized, Stream stream)
   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 SixLabors.ImageSharp.Image.EncodeVisitor.Visit[TPixel](Image`1 image)
   at SixLabors.ImageSharp.Image`1.Accept(IImageVisitor visitor)
   at SixLabors.ImageSharp.Advanced.AdvancedImageExtensions.AcceptVisitor(Image source, IImageVisitor visitor)
   at SixLabors.ImageSharp.Image.Save(Stream stream, IImageEncoder encoder)
   at SixLabors.ImageSharp.ImageExtensions.Save(Image source, Stream stream, IImageFormat format)
   at SixLabors.ImageSharp.Web.FormattedImage.Save(Stream destination)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(HttpContext context, Boolean processRequest, IImageResolver sourceImageResolver, ImageContext imageContext, IDictionary`2 commands)

The web site is deployed on a 64 bit windows server in iis, so I guess it is caused by the X86 call. Is there something I need to configure for it to work properly?

Thnx,
Arjan

Media bug

Most helpful comment

I got additional information from our hosting party. The CPU is a Xeon E5-2670 V3, but it is configured in compatibility mode. So those instructions are not available.

All 12 comments

/cc @JimBobSquarePants

@infofromca Do your research properly.

  1. License is Apache 2.0
  2. System.Drawing is NOT supported by Microsoft on servers.
  3. You鈥檙e referencing a 3 year old blog post.

@hishamco Raise an issue on our repo please looks like we鈥檙e just missing a supports check.

Thanks for your respond @JimBobSquarePants, I filed an issue there

@JimBobSquarePants
as I remember, there is a plan to change the licence.
by the way, what do you mean System.Drawing is NOT supported by Microsoft on servers.
thanks

One issue among many others:
On Unixes, System.Drawing is based on mono/libgdiplus, which has reliability flaws, unlikely to be fixed in the near future.

I've got a PR ready for a fix. Once merged, referencing our MyGet build will be the quickest way to get the fix.

That's very quick. I will test it as soon as I can. I also requested details on the cpu of the server where the site is hosted.

I tested the library and the exception no longer occurs. The image is resized correctly.

@JimBobSquarePants I had some trouble finding the nuget package. I had to check the build to find out that it was 1.0.0-unstable0048. The highest version is 1.0.0-unstable1162 which dates from April the 30th.

Yeah the automatic versioning tool we use is having a hiccup. I鈥檓 gonna update it today and hopefully that should fix it, otherwise I have to raise an issue upstream

I got additional information from our hosting party. The CPU is a Xeon E5-2670 V3, but it is configured in compatibility mode. So those instructions are not available.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeffolmstead picture jeffolmstead  路  4Comments

ns8482e picture ns8482e  路  4Comments

khoshroomahdi picture khoshroomahdi  路  4Comments

chillibug picture chillibug  路  4Comments

hishamco picture hishamco  路  3Comments