Skip to content

Can't load indexed color PSD file (regression) #1735

@nonkeltjebob

Description

@nonkeltjebob

Magick.NET version

14.0.0

Environment (Operating system, version and so on)

Windows (11 - 23H2) - .NET Framework 4.8 - x64 runtime

Description

Sample file: https://1drv.ms/u/s!AkVbxLucveB7gYsrjgsE5ctF9e4YUw?e=faNL0v

Upgrading from 13.7.0 to 14.0.0 I'm running against one conversion error (all our other tests run fine - kudos).
Simply loading the metadata (pinging) this image throws the error:

ImageMagick.MagickCorruptImageErrorException: 'improper image header `.\IndexedColor.psd' @ error/psd.c/ReadPSDLayersInternal/2042'

Loading the file in MagickImage works, but loading/pinging in MagickImageCollection fails.

I can load it in IrfanView just fine (I unfortunately don't have Photoshop on my machine to closer inspect the file) so it seems at first sight the file isn't corrupt. If it is corrupt, then it's actually a regression in the writing of the file, since it was generated by Magick.NET by resizing an original CMYK 2000x2000 PSD into this Indexed palette 200x200 PSD. I can supply additional code if necessary.

Note: might be #448 reintroduced, which came up while I was searching.
Note 2: there are some versions in between 13.7.0 and 14.0.0, but I'm having some local issues reverting back to previous versions to be able to nail down the regression window - I'll come back to this.

Steps to Reproduce

            using (var miCollection = new MagickImageCollection(path))
            {
                layerCnt = miCollection.Count;
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions