PluginProbe
QuickWebP – WebP & AVIF Image Optimizer, Compression & SEO for WordPress / 3.2.1
QuickWebP – WebP & AVIF Image Optimizer, Compression & SEO for WordPress v3.2.1
4.1.2 4.1.1 4.1.0 4.0.1 4.0.0 3.3.1 3.3.0 trunk 1.0.0 2.0.0 2.1.0 3.0.0 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8
quickwebp / includes / vendor / intervention / image / src / Intervention / Image / Commands / ChecksumCommand.php

ChecksumCommand.php in QuickWebP – WebP & AVIF Image Optimizer, Compression & SEO for WordPress 3.2.1, at includes/vendor/intervention/image/src/Intervention/Image/Commands/ChecksumCommand.php

30 lines 609 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Intervention\Image\Commands;
4
5 class ChecksumCommand extends AbstractCommand
6 {
7 /**
8 * Calculates checksum of given image
9 *
10 * @param \Intervention\Image\Image $image
11 * @return boolean
12 */
13 public function execute($image)
14 {
15 $colors = [];
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 }
30