1--TEST-- 2Test imagecolorstotal() function : basic functionality 3--SKIPIF-- 4<?php 5if(!extension_loaded('gd')) { 6 die('skip gd extension is not loaded'); 7} 8 9if(!function_exists('imagecolorstotal') || !function_exists('imagecreatefromgif')) { 10 die('skip imagecolorstotal and imagecreatefromgif functions not available in this build'); 11} 12?> 13--FILE-- 14<?php 15echo "*** Testing imagecolorstotal() : basic functionality ***\n"; 16 17// Get an image 18$gif = __DIR__."/php.gif"; 19$im = imagecreatefromgif($gif); 20 21echo 'Total colors in image: ' . imagecolorstotal($im); 22 23// Free image 24imagedestroy($im); 25?> 26--EXPECT-- 27*** Testing imagecolorstotal() : basic functionality *** 28Total colors in image: 128 29