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--SKIPIF-- 7<?php 8 if (!extension_loaded("gd")) die("skip GD not present"); 9 if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) { 10 die("skip test requires GD 2.2.2 or higher"); 11 } 12?> 13--FILE-- 14<?php 15$image = imagecreate(150, 150); 16 17$grey = imagecolorallocate($image,6,6,6); 18$gray = imagecolorallocate($image,15,15,15); 19 20$half = imagefilledarc ( $image, 75, 75, 70, 70, 0, 180, $grey, IMG_ARC_PIE ); 21$half2 = imagefilledarc ( $image, 75, 75, 70, 70, 0, -180, $gray, IMG_ARC_PIE ); 22 23$gamma = imagegammacorrect($image, 1, 5); 24var_dump((bool) $gamma); 25 26include_once __DIR__ . '/func.inc'; 27test_image_equals_file(__DIR__ . '/imagegammacorrect_variation1.png', $image); 28?> 29--EXPECT-- 30bool(true) 31The images are equal. 32