Блогът на Vipe Studio - WordPress ресурси и статии

36 налични WordPress статии

Уеб трикове

16.01.2019 Vipe Team

Тестов скрипт за ImageMagick

1. Create imagick.php
2. Add the following code in it

<?php
error_reporting(E_ALL);
ini_set( 'display_errors','1');
$im = new Imagick();
$im->newPseudoImage(50, 50, "gradient:blue-white");
$draw = new ImagickDraw();
$draw->pushPattern('gradient', 0, 0, 50, 50);
$draw->composite(Imagick::COMPOSITE_OVER, 0, 0, 50, 50, $im);
$draw->popPattern();
$draw->setFillPatternURL('#gradient');
$draw->setFontSize(52);
$draw->annotation(20, 50, "Wordpress-bg.com confirms!");
$canvas = new Imagick();
$canvas->newImage(390, 70, "black");
$canvas->drawImage($draw);
$canvas->borderImage('black', 1, 1);
$canvas->setImageFormat('png');
header("Content-Type: image/png");
echo $canvas;
?>

3. Open in a browser domain.com/imagick.php . If it is enabled it will return 'Wordpress-bg.com confirms'.