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, setImageBias --SKIPIF-- <?php require_once(dirname(__FILE__) ...

Decoded Output download

--TEST--
Test Imagick, setImageBias
--SKIPIF--
<?php 
    require_once(dirname(__FILE__) . '/skipif.inc'); 
    checkClassMethods('Imagick', array('setImageBias'));
?>
--FILE--
<?php

$bias = 0.5;

//requires ImageMagick version 6.9.0-1 to have an effect on convolveImage
function setImageBias($bias) {
    $imagick = new \Imagick();
    $imagick->newPseudoImage(640, 480, "magick:logo");

    $xKernel = array(
        -0.70, 0, 0.70,
        -0.70, 0, 0.70,
        -0.70, 0, 0.70
    );

    $imagick->setImageBias($bias * \Imagick::getQuantum());
    $imagick->convolveImage($xKernel, \Imagick::CHANNEL_ALL);

    $imagick->setImageFormat('png');

    $bytes = $imagick->getImageBlob();
    if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 
}

setImageBias($bias) ;
echo "Ok";
?>
--EXPECTF--
Deprecated: %s Imagick::setImageBias() is deprecated in %s
Ok

Did this file decode correctly?

Original Code

--TEST--
Test Imagick, setImageBias
--SKIPIF--
<?php 
    require_once(dirname(__FILE__) . '/skipif.inc'); 
    checkClassMethods('Imagick', array('setImageBias'));
?>
--FILE--
<?php

$bias = 0.5;

//requires ImageMagick version 6.9.0-1 to have an effect on convolveImage
function setImageBias($bias) {
    $imagick = new \Imagick();
    $imagick->newPseudoImage(640, 480, "magick:logo");

    $xKernel = array(
        -0.70, 0, 0.70,
        -0.70, 0, 0.70,
        -0.70, 0, 0.70
    );

    $imagick->setImageBias($bias * \Imagick::getQuantum());
    $imagick->convolveImage($xKernel, \Imagick::CHANNEL_ALL);

    $imagick->setImageFormat('png');

    $bytes = $imagick->getImageBlob();
    if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 
}

setImageBias($bias) ;
echo "Ok";
?>
--EXPECTF--
Deprecated: %s Imagick::setImageBias() is deprecated in %s
Ok

Function Calls

dirname 1

Variables

None

Stats

MD5 c474920a1924c8ce256a18989eb703a9
Eval Count 0
Decode Time 90 ms