Skip to content

Converting Tif file with 2 alpha channels yields scrambled result. #1523

@E-Tromp

Description

@E-Tromp

Magick.NET version

Magick.NET-Q8-AnyCPU 13.5.0

Environment (Operating system, version and so on)

MS Windows11 [Version 10.0.22631.3007] ; .NET Core 3.1

Description

When the tiff file (from the link provided in the Reproduction steps) is converted to jpg, the result looks scrambled.
The Tif file is an RGB with two alpha channels; in the image.Channels they appear as "Alpha" and "Meta0". Other tif files I tried (with just a single alpha channel) cause no problem.

The file was processed correctly with Magick.NET 11.0.0. The problem started after upgrading to 11.1.0. and still exists in 13.5.0.

Steps to Reproduce

Download sample file from: https://drive.google.com/file/d/185VJjumyKpmrHFSCMlbR9nleIhXnra6f/view?usp=sharing
Code sample to read and store the image: `

    private static void ProcessFileToJpgSample(string fileName, string outputPath, string batchId)
    {
        var image = new IM.MagickImage();

        image.Read(fileName);

        image.Format = MagickFormat.Jpg;

        // Store
        var fileInfo = new FileInfo(fileName);
        string outputFileName = $@"{fileInfo.Name}_{batchId}.jpg";

        image.Write($@"{outputPath}{outputFileName}");
    }

`
Storing the file as Png or keeping as tif does not make a difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions