Tech H8rs Imagemagick unable to identify EPS files.

Posted By

I experienced a problem recently where one of my applications which relies on imagemagick's identify script failed on certain files. When executing identify filename_blah.eps on Ubuntu Jaunty, it would segfault and crash with a rather length trace stack, starting with libc6.

======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7af9da8]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7af9d60]
/usr/lib/ImageMagick-6.4.5/modules-Q16/coders/ps.so[0xb7f24fe4]
/usr/lib/ImageMagick-6.4.5/modules-Q16/coders/ps.so[0xb7f2154a]
/usr/lib/libMagickCore.so.1(ReadImage+0xce9)[0xb7d52209]
/usr/lib/libMagickCore.so.1(BlobToImage+0x157)[0xb7d21c57]
/usr/lib/ImageMagick-6.4.5/modules-Q16/coders/ept.so[0xb7f1a6b5]
/usr/lib/libMagickCore.so.1(ReadImage+0x1cb)[0xb7d516eb]
/usr/lib/libMagickCore.so.1(ReadImages+0x1b2)[0xb7d52a32]
/usr/lib/libMagickWand.so.1(IdentifyImageCommand+0x4cc)[0xb7c654cc]
identify[0x8048c42]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7a12775]
identify[0x8048a71]

This seems to be based solely in some combination of that version of imagemagick and the core libraries of choice. The version that fails to identify the files is 6.4.5.4.dfsg1-1ubuntu3, however when I switch to either the previous stable version of 6.3.7.9.dfsg1-2ubuntu3 or the newest stable of 6.5.3-2, the command executes successfully.

So, if anyone happens to get this same error on eps vector files, simply switching to a different version of imagemagick should resolve your issue.

Bug report about the issue on ubuntu's bug tracker.
https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/359181

The source is easy enough to compile if you want to get the newest version, just a simple "./configure; make; sudo make install" suffices. If you prefer an up-to-date Jaunty-based DEB file, contact me and I'll send you one of my compiled ones.