Skip to content

rowSpan after Image.Load<Bgr24>(filename.bmp) fails on Linux, same image file + code work on Windows #305

Closed
@ghost

Description

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

For me the unit test below works for Windows, but fails for Linux.
When i change "Image.Load<Bgr24>(sourceFilePath)" to Image.Load(sourceFilePath) it works for both.

Steps to Reproduce

    [Theory]
    [InlineData("TestData/Screens/white.bmp", 255)]
    public void DummyTest(string sourceFilePath, byte expected_rgb)
    {
        using (var image = Image.Load<Bgr24>(sourceFilePath))
        {
            for (int y = 0; y < image.Height; y++)
            {
                var rowSpan = image.GetRowSpan(y);
                for (int x = 0; x < image.Width; x++)
                {
                    if (expected_rgb != rowSpan[x].R ||
                        expected_rgb != rowSpan[x].G ||
                        expected_rgb != rowSpan[x].B)
                    {
                        output.WriteLine(string.Format("failed at y={0} x={1}", y, x));
                        output.WriteLine(string.Format("r={0} g={1} b={2}", rowSpan[x].R, rowSpan[x].G, rowSpan[x].B));
                    }

                    Assert.Equal(expected_rgb, rowSpan[x].R);
                    Assert.Equal(expected_rgb, rowSpan[x].G);
                    Assert.Equal(expected_rgb, rowSpan[x].B);
                }
            }
        }
    }

System Configuration

  • Linux: Ubuntu-Server 14.04.1 LTS Trusty Tahr (3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux)

  • Windows: Windwos 10 64bit

  • ImageSharp version: ImageSharp 1.0.0-alpha9-00182

  • Other ImageSharp packages and versions:

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

  • .NET Framework version: .Net Core 2.0, failed with .Net Core 1.1 as well

  • Additional information:

white.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions