Imagesharp: PNG encoder throws an exception on x64

Created on 13 Jun 2020  路  5Comments  路  Source: SixLabors/ImageSharp

Seems there's a lake on supporting this on 64 bit, for more details, please refer to https://github.com/OrchardCMS/OrchardCore/issues/6414

bug png

Most helpful comment

Steps to Reproduce

fire the following request to OrchardCore: https://my.domain/media/myimage.png?width=100

System Configuration

  • ImageSharp version:
    SixLabors.ImageSharp 1.0.0-rc0002

  • Other ImageSharp packages and versions:
    SixLabors.ImageSharp.Web 1.0.0-rc0003

  • Environment (Operating system, version and so on):

Published the web site in devops

- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: false
    projects: '**/CmsWeb.csproj'
    arguments: '-o $(Build.ArtifactStagingDirectory) -r win-x64 --self-contained'

windows server 64 bit.
.net core 3.1.5

It fails for all the png files I tested, but here's an example.
digid

All 5 comments

@hishamco to make it actionable for us, can you please:

  1. Fill the issue template, making sure you include:

    • The exact type of your CPU

    • .NET Core version

    • OS version

  2. Provide the PNG you are trying to resize. Note: based on stack trace, the issue is in the PNG encoder.

Steps to Reproduce

fire the following request to OrchardCore: https://my.domain/media/myimage.png?width=100

System Configuration

  • ImageSharp version:
    SixLabors.ImageSharp 1.0.0-rc0002

  • Other ImageSharp packages and versions:
    SixLabors.ImageSharp.Web 1.0.0-rc0003

  • Environment (Operating system, version and so on):

Published the web site in devops

- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: false
    projects: '**/CmsWeb.csproj'
    arguments: '-o $(Build.ArtifactStagingDirectory) -r win-x64 --self-contained'

windows server 64 bit.
.net core 3.1.5

It fails for all the png files I tested, but here's an example.
digid

Throwing line is here.

https://github.com/SixLabors/ImageSharp/blob/0890bca63e9843ae36abf1dd8ad29a8ab4fe228a/src/ImageSharp/Formats/Png/Zlib/Adler32.cs#L133

The fix should be simple. I'm checking for Sse3 not the correct supplementary Ssse3 support.

c# Ssse3.MultiplyAddAdjacent.MultiplyAddAdjacent(Vector128<byte> left, Vector128<sbyte> right)

Would this happen on any Windows machine or does it depend on the cpu ?

@sebastienros depends on the CPU. Many (most) likely support Ssse3

https://en.m.wikipedia.org/wiki/SSSE3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JimBobSquarePants picture JimBobSquarePants  路  3Comments

jarroda picture jarroda  路  3Comments

Hawxy picture Hawxy  路  3Comments

xakep139 picture xakep139  路  3Comments

xakep139 picture xakep139  路  4Comments