apache2checker/checkers/php-imagick.php
2025-05-05 08:38:04 +03:00

35 lines
1.6 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.",
"Uuses the Imagick extension to load an existing image (input.jpg), apply visual effects such as blur and color modulation, and save the processed image as output.png. The resulting image is then displayed at the bottom of the web page.");
$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,$outputPath) {
$image = new Imagick($pathToImage);
$image->blurImage(3, 2);
$image->modulateImage(110, 120, 100);
$image->setImageFormat('png');
if (!$image->writeImage($outputPath)) {
die('Error');
}
$image->destroy();
}
if (!file_exists($outputPath)) {
imageTricks($pathToImage,$outputPath);
}
?>
<html>
<div style="margin-top: 50px; text-align: center;">
<img src="/styles/bebs.png" alt="Не обработанное изображение" style="max-width: 100%;">
<img src="/styles/bebs.changed.png" alt="Обработанное изображение" style="max-width: 100%;">
</div>
</html>