ImageMagick COM Object Not Hiding Errors With TIFF Files

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
aneiman

ImageMagick COM Object Not Hiding Errors With TIFF Files

Post 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
aneiman

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Post by aneiman »

Has anyone else run into this problem? Any ideas?
PCPete

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Post 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!
ForgotOldAdd

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Post by ForgotOldAdd »

What about saving the transparency mask in a different file and compose back in the end?
PCPete

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick COM Object Not Hiding Errors With TIFF Files

Post by magick »

Download ImageMagick 6.3.8-5. It has a patch to safely ignore TIFF warnings.
Post Reply