apache2checker/checkers/php-imagick.php
2025-05-05 08:27:11 +03:00

39 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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();
$pathToImage = "/home/u525748/php84test.ff14wiki.ru/www/styles/bebs.png";
$outputPath = "/home/u525748/php84test.ff14wiki.ru/www/styles/bebs.changed.png";
function imageTricks($pathToImage,$output) {
$image = new Imagick($pathToImage);
$image->blurImage(3, 2);
$image->modulateImage(110, 120, 100); // яркость, насыщенность, оттенок
$draw = new ImagickDraw();
$draw->setFont('Arial');
$draw->setFontSize(36);
$draw->setFillColor('red');
$draw->setTextAlignment(Imagick::ALIGN_CENTER);
$image->annotateImage($draw, $image->getImageWidth()/2, $image->getImageHeight() - 30, 0, 'Обработано через Imagick');
$image->setImageFormat('png');
$image->writeImage($output);
$image->destroy();
}
imageTricks($pathToImage,$outputPath);
?>
<div style="margin-top: 50px; text-align: center;">
<img src="/home/u525748/php84test.ff14wiki.ru/www/styles/bebs.png" alt="Не обработанное изображение" style="max-width: 100%;">
<img src="/home/u525748/php84test.ff14wiki.ru/www/styles/bebs.changed.png" alt="Обработанное изображение" style="max-width: 100%;">
</div>