Page 1 of 1

ImageMagick COM Object Not Hiding Errors With TIFF Files

Posted: 2007-09-26T08:24:00-07:00
by aneiman
I'm using v6.3.5 of Imagemagick:
identify -version
Version: ImageMagick 6.3.5 09/18/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
I'm writing an application in VB.NET (VS2005) that redacts specific fields on specific pages in a multi-page TIFF file. I can run the convert command from the command prompt and when I use the "-quiet" option, it hides the errors:
identify 0000002A.TIF
0000002A.TIF TIFF 2544x3298 2544x3298+0+0 DirectClass 1-bit 78.6523kb 0.156u 0:01
identify: 0000002A.TIF: unknown field with tag 33000 (0x80e8) encountered. `TIFFReadDirectory'.

identify -quiet 0000002A.TIF
0000002A.TIF TIFF 2544x3298 2544x3298+0+0 DirectClass 1-bit 78.6523kb 0.172u 0:01
However, when I run it from the program, an exception happens and I can't proceed further. This happens when I use the identify command as well.

Here's a snippet of the code:

Code: Select all

        Dim paramsList As ArrayList

        paramsList = New ArrayList()
        paramsList.Add("-quiet")
        paramsList.Add(docObj.Path)

        Try
            Dim params1 As Object() = paramsList.ToArray(Type.GetType("System.Object"))

            magickObj.Identify(params1)

            ' retrieve page count here....
        Catch ex As Exception
            Exit Sub
        End Try
The program tries to identify the image and the exception returns:
? ex.Message
"identity: 350: C:\Release\Images\0000002A.TIF: unknown field with tag 33000 (0x80e8) encountered. `TIFFReadDirectory':
"
I don't have an option of changing the TIFF file to get rid of the warnings, but it appears the "-quiet" option is not working correctly.

Any ideas? I apologize beforehand if I missed anything in the forum that might have solved this problem or if there's something documenting a way to work around/with this.

Here's the sample image I'm working with:
http://public.strahd98.fastmail.fm/work/0000002A.TIF

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Posted: 2007-10-05T07:45:26-07:00
by aneiman
Has anyone else run into this problem? Any ideas?

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Posted: 2008-01-15T11:51:56-07:00
by PCPete
Yes I have run into it today. It seems that is has something to do with how the .Tif or .Tiff was composed. If you use layers in the Tiff and save with layers, it will encounter this error. If you discard layers and save a copy, it will not encounter this error. However I am using transparency so I need the layers in tact. Please advise!

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Posted: 2008-01-17T10:32:14-07:00
by ForgotOldAdd
What about saving the transparency mask in a different file and compose back in the end?

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Posted: 2008-01-17T11:41:28-07:00
by PCPete
The layers really have nothing to do with transparency. Tiffs can only handle ON or OFF pixels for transparency, so they can't, for example, do a 50% transparent image over text or the like. I have a non-layered, transparent background tiff that uploads just fine, the layered ones always fail.

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Posted: 2008-02-07T10:20:40-07:00
by magick
Download ImageMagick 6.3.8-5. It has a patch to safely ignore TIFF warnings.