mkoppanen/php-dmtx — Issue #2: Imagick fails after enabling dmtx extension
Author: blubberblah
Created: 2012-01-24 14:10:54+00:00
State: open

Hi Mikko,

after enabling the dmtx-extension, instantiating an imagick object fails with the following message:

Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `/tmp/magick-XXtng9QR'' in /usr/local/src/dmtx/mkoppanen-php-dmtx-87b8fa2/test.php:6

Ubuntu 10.04.3 LTS 64bit
Zend Server 5.6
Imagick-Extension: php-5.3-imagick-zend-server 5.3.9+b263

I've compiled the dmtx-extension as follows:

apt-get install libdmtx-utils libdmtx-dev libmagickwand-dev
mkdir -p /usr/local/src/dmtx
cd /usr/local/src/dmtx
wget -O php-dmtx-master.tar.gz https://github.com/mkoppanen/php-dmtx/tarball/master
tar -xzf php-dmtx-master.tar.gz
cd mkoppanen-php-dmtx-87b8fa2
phpize
./configure
make

After enabling the extension I'm able to create a barcode in php as follows:

$code='978149769091';
$w = new \dmtxWrite($code);
$w->save("testdatamatrix.png", \dmtx::SYMBOL_SQUARE_AUTO);

This results in a valid testdatamatrix.png.

Trying to open the created image with imagick (or any other png-image):

new \Imagick('testdatamatrix.png');

results in the error mentioned above.

After disabling the dmtx-extension and opening the image

new \Imagick('testdatamatrix.png');

everything works as expected and no exception is being thrown.

Maybe you have an idea,
thanks in advance,
regards,
Holger