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);
thx