Skip to content

tag not ignored by ignore-tags #1844

@ghosttie

Description

@ghosttie

Magick.NET version

Magick.NET-Q8-AnyCPU 14.6.0

Environment (Operating system, version and so on)

Windows 10

Description

When I try to load a TIF using return new MagickImageCollection(stream); I get the exception

ImageMagick.MagickCoderErrorException
  HResult=0x80131500
  Message=Defined set_field_type of custom tag 3 (Tag 3) is TIFF_SETGET_UNDEFINED and thus tag is not read from file. `TIFFFetchNormalTag' @ error/tiff.c/TIFFErrors/574
  Source=Magick.NET-Q8-AnyCPU
  StackTrace:
   at ImageMagick.MagickImageCollection.NativeMagickImageCollection.ReadStream(IMagickSettings`1 settings, ReadWriteStreamDelegate reader, SeekStreamDelegate seeker, TellStreamDelegate teller, Void* data)
   at ImageMagick.MagickImageCollection.NativeMagickImageCollection.ReadStream(IMagickSettings`1 settings, ReadWriteStreamDelegate reader, SeekStreamDelegate seeker, TellStreamDelegate teller)
   at ImageMagick.MagickImageCollection.AddImages(Stream stream, IMagickReadSettings`1 readSettings, Boolean ping)
   at ImageMagick.MagickImageCollection.Read(Stream stream, IMagickReadSettings`1 readSettings)
   at ImageMagick.MagickImageCollection.Read(Stream stream)
   at ImageMagick.MagickImageCollection..ctor(Stream stream)

Steps to Reproduce

The image opens in other applications, so I assume Magick.NET is more strict about unknown tags. I tried to tell it to ignore the tag like this:

var readSettings = new MagickReadSettings {
	Format = MagickFormat.Tiff
};
readSettings.SetDefine(MagickFormat.Tif, "ignore-tags", "3,2,8");

return new MagickImageCollection(stream, readSettings);

but I get the same exception. I also tried this

var readSettings = new MagickReadSettings {
	Format = MagickFormat.Tiff,
	Defines = new TiffReadDefines {
		IgnoreTags = ["3", "2", "8"]
	}
};

return new MagickImageCollection(stream, readSettings);

but I still get the same exception. I also tried

var c = new MagickImageCollection();
c.AddRange(stream, readSettings);

instead of passing the stream to the MagickImageCollection constructor but it didn't make any difference.

Images

I can't upload the problem TIF because it contains confidential data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions