Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- Test Imagick, clutImage --SKIPIF-- <?php $imageMagickRequiredVersion=0x675; requi..
Decoded Output download
--TEST--
Test Imagick, clutImage
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc');
?>
--FILE--
<?php
$draw = new \ImagickDraw();
$draw->setStrokeOpacity(0);
$draw->setFillColor('black');
$points = [
['x' => 40 * 3, 'y' => 10 * 5],
['x' => 20 * 3, 'y' => 20 * 5],
['x' => 70 * 3, 'y' => 50 * 5],
['x' => 80 * 3, 'y' => 15 * 5],
];
$draw->polygon($points);
$imagick = new \Imagick();
$imagick->setColorspace(\Imagick::COLORSPACE_GRAY);
$imagick->newPseudoImage(
300, 300,
"xc:white"
);
$imagick->drawImage($draw);
$imagick->blurImage(0, 10);
$draw = new \ImagickDraw();
$draw->setStrokeOpacity(1);
$draw->setFillColor('red');
$draw->point(0, 2);
$draw->setFillColor('yellow');
$draw->rectangle(0, 0, 1, 1);
$gradient = new Imagick();
$gradient->newPseudoImage(1, 5, 'xc:black');
$gradient->drawImage($draw);
$gradient->setImageFormat('png');
$imagick->setImageFormat('png');
// This test is for IM < 7 so setInterpolate not available
// Which probably means the clutImage method isn't usuable...
//$imagick->setInterpolateMethod(Imagick::INTERPOLATE_BILINEAR);
$imagick->clutImage($gradient);
$bytes = $imagick->getImageBlob();
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
echo "Ok";
?>
--EXPECTF--
Ok
Did this file decode correctly?
Original Code
--TEST--
Test Imagick, clutImage
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc');
?>
--FILE--
<?php
$draw = new \ImagickDraw();
$draw->setStrokeOpacity(0);
$draw->setFillColor('black');
$points = [
['x' => 40 * 3, 'y' => 10 * 5],
['x' => 20 * 3, 'y' => 20 * 5],
['x' => 70 * 3, 'y' => 50 * 5],
['x' => 80 * 3, 'y' => 15 * 5],
];
$draw->polygon($points);
$imagick = new \Imagick();
$imagick->setColorspace(\Imagick::COLORSPACE_GRAY);
$imagick->newPseudoImage(
300, 300,
"xc:white"
);
$imagick->drawImage($draw);
$imagick->blurImage(0, 10);
$draw = new \ImagickDraw();
$draw->setStrokeOpacity(1);
$draw->setFillColor('red');
$draw->point(0, 2);
$draw->setFillColor('yellow');
$draw->rectangle(0, 0, 1, 1);
$gradient = new Imagick();
$gradient->newPseudoImage(1, 5, 'xc:black');
$gradient->drawImage($draw);
$gradient->setImageFormat('png');
$imagick->setImageFormat('png');
// This test is for IM < 7 so setInterpolate not available
// Which probably means the clutImage method isn't usuable...
//$imagick->setInterpolateMethod(Imagick::INTERPOLATE_BILINEAR);
$imagick->clutImage($gradient);
$bytes = $imagick->getImageBlob();
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
echo "Ok";
?>
--EXPECTF--
Ok
Function Calls
None |
Stats
MD5 | e1f496a53bd6288b8404b8070da3750c |
Eval Count | 0 |
Decode Time | 124 ms |