Magick.NET icon indicating copy to clipboard operation
Magick.NET copied to clipboard

How to ignore unknow tiff Tag(32934 , etc) when use MagickImage open such tiff image ?

Open Charltsing opened this issue 1 year ago • 5 comments

Magick.NET version

13.7

Environment (Operating system, version and so on)

Windows10, net framework 4.7.2

Description

Tag32934.zip

MagickImage open a tiff file with Tag 32934 failed, i ues setting ignore it and open this tiff file successfully . settings.SetDefines(new TiffReadDefines { IgnoreTags = new[] {"32934" } });

I want to know how to ignore unknown tags in the future, so as to avoid errors when opening such tiff images with unknow Tag?

Steps to Reproduce

using (MagickImage magickimage = new MagickImage(picbytes, settings))

Charltsing avatar May 09 '24 11:05 Charltsing

The way this option works is that it tells the tiff library to ignore the tags that you specified. There is no option to tell the library that it should ignore all unknown tags.

dlemstra avatar May 09 '24 14:05 dlemstra

I want to avoid Magic.Net reporting an error when encountering an unknown Tiff Tag it should at least be able to open the image.

Charltsing avatar May 10 '24 15:05 Charltsing

The problem is not that there are unknown tiff tags. The problem is that one of those tiff tags is invalid and contains data that cannot be read by the tiff library. Both a warning and error are being raised.

dlemstra avatar May 10 '24 17:05 dlemstra

Would you like to add an optional options to ignore such warning and error when open tiff image ?

I hope to show the image even if it includes invalid tags.

Charltsing avatar May 11 '24 04:05 Charltsing

That is out of my control. The library that is being used doesn't have an option to ignore these kind of errors.

dlemstra avatar May 11 '24 08:05 dlemstra