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