php error on compositeImage

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
Navacho
Posts: 1
Joined: 2011-03-24T11:12:29-07:00
Authentication code: 8675308

php error on compositeImage

Post by Navacho »

hi

i try to composite some images with a simple script. i execute the script on the commandline with php-win.exe.
the image is created correctly but i get an application error of php at the command "compositeImage".
the error says something like: "The operation "read" could not be performed on the memory"

---------------------------
php-win.exe - Fehler in Anwendung
---------------------------
Die Anweisung in "0x728840a9" verweist auf Speicher in "0x728840a9". Der Vorgang "read" konnte nicht auf dem Speicher durchgeführt werden.
Klicken Sie auf "OK", um das Programm zu beenden.
Klicken Sie auf "Abbrechen", um das Programm zu debuggen.
---------------------------
OK Abbrechen
---------------------------

my commandline
c:/xampplite/php/php-win.exe -f "c:/xampplite/htdocs/imagick.php" -- "c:/inputDir/" "c:/outputDir/" "output.gif" "pic1.gif" "pic2.gif|0|0"

Code: Select all

$inputDir = str_replace('/', '\\', $argv[1]);
$outputDir = str_replace('/', '\\', $argv[2]);
$outputName = $argv[3];

/* Index 4 = first image; Index 5 to index n = ImageName|X-Coord|Y-Coord; Image order = z-index */
$img = new Imagick($inputDir.$argv[4]);
for ($i=5; !empty($argv[$i]); $i++) {
	$newImg = explode("|", $argv[$i]);
	$new = new Imagick($inputDir.$newImg[0]);
	$img->compositeImage($new,Imagick::COMPOSITE_OVER,$newImg[1],$newImg[2]);
	$new->destroy();
}

$img->setImageFormat("gif");
$img->writeImage($outputDir.$outputName);
somebody got an idea why this error occures?
thx
Post Reply