Using Magick++ and libtiff intermittently
Posted: 2008-10-07T08:50:01-07:00
I have got a large application which calls both ImageMagick libraries (via Magick++) as well as libtiff directly. It seems these libraries get somehow entangled behind the scenes, when calling libtiff I get an assert failure from ImageMagick (if there occurred a warning in earlier ImageMagick call).
Maybe I have somehow to clear the "warning exception" before continuing, but I'm not quite sure how to do this.
Scenario:
Read a TIFF image with ImageMagick. There is an extra tag which causes an ImageMagick warning: "unknown field with tag 33560 (0x8318) encountered.".
Read another TIFF file in the same process using libtiff directly:
magick/exception.c:948: ThrowMagickExceptionList: Assertion `exception->signature == 0xabacadabUL' failed.
Aborted (core dumped)
If there is no warning in the first call, the sequence appears to work.
How to get it working? Thanks in advance!
Paavo
Stack backtrace from gdb:
#0 0x00002aaac51a0535 in raise () from /lib64/libc.so.6
#1 0x00002aaac51a1990 in abort () from /lib64/libc.so.6
#2 0x00002aaac5199c16 in __assert_fail () from /lib64/libc.so.6
#3 0x00002aaaab280e5a in ThrowMagickExceptionList () from /usr/lib64/libMagick.so.10
#4 0x00002aaaab280efa in ThrowMagickException () from /usr/lib64/libMagick.so.10
#5 0x00002aaaad7b29e0 in RegisterTIFFImage () from /usr/lib64/ImageMagick-6.3.0/modules-Q16/coders/tiff.so
#6 0x00002aaaabac06e2 in TIFFErrorExt () from /usr/lib64/libtiff.so.3
#7 0x00002aaaabad522d in TIFFInitLZW () from /usr/lib64/libtiff.so.3
#8 0x00002aaaabadd9e5 in TIFFReadEncodedStrip () from /usr/lib64/libtiff.so.3
#9 -- Our application code --
Maybe I have somehow to clear the "warning exception" before continuing, but I'm not quite sure how to do this.
Scenario:
Read a TIFF image with ImageMagick. There is an extra tag which causes an ImageMagick warning: "unknown field with tag 33560 (0x8318) encountered.".
Read another TIFF file in the same process using libtiff directly:
magick/exception.c:948: ThrowMagickExceptionList: Assertion `exception->signature == 0xabacadabUL' failed.
Aborted (core dumped)
If there is no warning in the first call, the sequence appears to work.
How to get it working? Thanks in advance!
Paavo
Stack backtrace from gdb:
#0 0x00002aaac51a0535 in raise () from /lib64/libc.so.6
#1 0x00002aaac51a1990 in abort () from /lib64/libc.so.6
#2 0x00002aaac5199c16 in __assert_fail () from /lib64/libc.so.6
#3 0x00002aaaab280e5a in ThrowMagickExceptionList () from /usr/lib64/libMagick.so.10
#4 0x00002aaaab280efa in ThrowMagickException () from /usr/lib64/libMagick.so.10
#5 0x00002aaaad7b29e0 in RegisterTIFFImage () from /usr/lib64/ImageMagick-6.3.0/modules-Q16/coders/tiff.so
#6 0x00002aaaabac06e2 in TIFFErrorExt () from /usr/lib64/libtiff.so.3
#7 0x00002aaaabad522d in TIFFInitLZW () from /usr/lib64/libtiff.so.3
#8 0x00002aaaabadd9e5 in TIFFReadEncodedStrip () from /usr/lib64/libtiff.so.3
#9 -- Our application code --