1--TEST--
2Testing imagegammacorrect() of GD library with non TrueColor image
3--CREDITS--
4Rafael Dohms <rdohms [at] gmail [dot] com>
5#testfest PHPSP on 2009-06-20
6--EXTENSIONS--
7gd
8--SKIPIF--
9<?php
10    if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
11        die("skip test requires GD 2.2.2 or higher");
12    }
13    if (!(imagetypes() & IMG_PNG)) {
14        die("skip No PNG support");
15    }
16?>
17--FILE--
18<?php
19$image = imagecreate(150, 150);
20
21$grey = imagecolorallocate($image,6,6,6);
22$gray = imagecolorallocate($image,15,15,15);
23
24$half =  imagefilledarc ( $image, 75, 75, 70, 70, 0, 180, $grey, IMG_ARC_PIE );
25$half2 =  imagefilledarc ( $image, 75, 75, 70, 70, 0, -180, $gray, IMG_ARC_PIE );
26
27$gamma = imagegammacorrect($image, 1, 5);
28var_dump((bool) $gamma);
29
30include_once __DIR__ . '/func.inc';
31test_image_equals_file(__DIR__ . '/imagegammacorrect_variation1.png', $image);
32?>
33--EXPECT--
34bool(true)
35The images are equal.
36