Cheetah
ChecksumCommand.php
Go to the documentation of this file.
1 <?php
2 
4 
6 {
13  public function execute($image)
14  {
15  $colors = array();
16 
17  $size = $image->getSize();
18 
19  for ($x=0; $x <= ($size->width-1); $x++) {
20  for ($y=0; $y <= ($size->height-1); $y++) {
21  $colors[] = $image->pickColor($x, $y, 'array');
22  }
23  }
24 
25  $this->setOutput(md5(serialize($colors)));
26 
27  return true;
28  }
29 }
Intervention\Image\Commands
Definition: AbstractCommand.php:3
php
Intervention\Image\Commands\ChecksumCommand
Definition: ChecksumCommand.php:6
Intervention\Image\Commands\AbstractCommand\setOutput
setOutput($value)
Definition: AbstractCommand.php:75
Intervention\Image\Commands\ChecksumCommand\execute
execute($image)
Definition: ChecksumCommand.php:13
Intervention\Image\Commands\AbstractCommand
Definition: AbstractCommand.php:6