xref: /PHP-8.0/ext/gd/tests/bug24155.phpt (revision c5401854)
1--TEST--
2Bug #24155 (gdImageRotate270 rotation problem).
3--SKIPIF--
4<?php
5    if (!extension_loaded('gd')) {
6        die("skip gd extension not available\n");
7    }
8    if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
9?>
10--FILE--
11<?php
12    $dest = dirname(realpath(__FILE__)) . '/bug24155.png';
13    @unlink($dest);
14
15    $im = imagecreatetruecolor(30, 50);
16    imagefill($im, 0, 0, (16777215 - 255));
17    $im = imagerotate($im, 270, 255);
18    imagepng($im, $dest);
19
20    $im2 = imagecreatefrompng($dest);
21
22    // Uniform fill + n x 90degrees rotation , the color value does not change
23    $col = imagecolorat($im2, 20, 20);
24    // 16777215 - 255 = 16776960
25    echo "$col\n";
26
27    @unlink($dest);
28?>
29--EXPECT--
3016776960
31