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
/cc @JimBobSquarePants
can we consider other libs ?
for 1--this
2--licence in future
https://devblogs.microsoft.com/dotnet/net-core-image-processing/
maybe the best is
https://www.nuget.org/packages/System.Drawing.Common/
https://github.com/dotnet/runtime/issues/21980
@infofromca Do your research properly.
@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
Trust me on this, it鈥檚 my library...
Re System.Drawing
https://docs.microsoft.com/en-us/dotnet/api/system.drawing?redirectedfrom=MSDN&view=dotnet-plat-ext-3.1#remarks
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.
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.