Quantcast
Channel: magick Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1011

Commented Unassigned: Error reading TIF file [1407]

$
0
0
I am trying to convert some TIF files to PDF and ran into a problem with one of the files. I have added the file as an attachment here.

This is the exact error that I get,

> : Null count for "Tag 34026" (type 1, writecount -3, passcount 1). `_TIFFVSetField' @ error/tiff.c/TIFFErrors/565

Under __RelatedExceptions__, I also see a number of statements similar to,

> Unknown field with tag 34030 (0x84ee) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/905

This is the exact place where exception gets thrown,

```
using(MagickImage image = new MagickImage("STREAM CONTAINING TIF FILE CONTENT"))
{
// Do something with the file
}
```

NuGet Package details:
> <package id="Magick.NET-Q8-AnyCPU" version="7.0.2.400" targetFramework="net452" />

Any reasons on why this is happening and some possible workarounds for fixing the problem would be really appreciate.
Comments: Your tiff file contains invalid TIFF tags. Our tiff reader is very picky about them. You can however tell Magick.NET to ignore certain tags with the following code: ```C# using (MagickImage image = new MagickImage()) { /* Current version of Magick.NET */ MagickReadSettings settings = new MagickReadSettings(); settings.SetDefine(MagickFormat.Tiff, "ignore-tags", "34025, 34022, 34026"); /* Next version of Magick.NET */ MagickReadSettings settings = new MagickReadSettings(new TiffReadDefines() { IgnoreTags = new string[] { "34025", "34022", "34026" } }); image.Read("STREAM CONTAINING TIF FILE CONTENT", settings); // Do something with the file } ``` As you might have noticed there is also a small code block that will work in the next version of Magick.NET. It appears that I did not make it easy to set the tags to ignore so I just push a patch to make that easier.

Viewing all articles
Browse latest Browse all 1011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>