public function colorTotal() { // Set the image resource and get the total number of colors. $this->createResource(); $colors = imagecolorstotal($this->resource); // Destroy the image resource. $this->destroy(); return $colors; }
public function testColorTotal() { $i = new Gd(__DIR__ . '/../tmp/test.gif'); $this->assertEquals(16, $i->colorTotal()); }