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
15/* Prototype  : int imagecolorstotal  ( resource $image  )
16 * Description: Find out the number of colors in an image's palette
17 * Source code: ext/gd/gd.c
18 */
19
20echo "*** Testing imagecolorstotal() : basic functionality ***\n";
21
22// Get an image
23$gif = dirname(__FILE__)."/php.gif";
24$im = imagecreatefromgif($gif);
25
26echo 'Total colors in image: ' . imagecolorstotal($im);
27
28// Free image
29imagedestroy($im);
30?>
31
32===DONE===
33--EXPECTF--
34*** Testing imagecolorstotal() : basic functionality ***
35Total colors in image: 128
36===DONE===
37