apache2checker/checkers/php-imagick.php
2025-05-05 08:18:25 +03:00

42 lines
1.5 KiB
PHP

<?php
include("baseModule.php");
$checker = new BaseModule(
"imagick",
"Igbinary is a drop in replacement for the standard PHP serializer. Instead of the time and space consuming textual representation used by PHP\'s serialize(), igbinary stores PHP data structures in a compact binary form. Memory savings are significant when using memcached, APCu, or similar memory based storages for serialized data. The typical reduction in storage requirements are around 50%. The exact percentage depends on the data.",
"");
$checker->printInfo();
function imageTricks($pathToImage) {
$im = new Imagick("test.png");
$im->thumbnailImage(200, null);
$im->borderImage(new ImagickPixel("white"), 5, 5);
$reflection = $im->clone();
$reflection->flipImage();
$gradient = new Imagick();
$gradient->newPseudoImage($reflection->getImageWidth() + 10, $reflection->getImageHeight() + 10, "gradient:transparent-black");
$reflection->compositeImage($gradient, imagick::COMPOSITE_OVER, 0, 0);
$reflection->setImageOpacity( 0.3 );
$canvas = new Imagick();
$width = $im->getImageWidth() + 40;
$height = ($im->getImageHeight() * 2) + 30;
$canvas->newImage($width, $height, new ImagickPixel("black"));
$canvas->setImageFormat("png");
$canvas->compositeImage($im, imagick::COMPOSITE_OVER, 20, 10);
$canvas->compositeImage($reflection, imagick::COMPOSITE_OVER, 20, $im->getImageHeight() + 10);
header("Content-Type: image/png");
echo $canvas;
}
imageTricks("/home/u525748/php84test.ff14wiki.ru/www/styles/bebs.png");