PngOut.php in Image Optimize Binaries 8
File
src/Plugin/ImageAPIOptimizeProcessor/PngOut.php
View source
<?php
namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
class PngOut extends ImageAPIOptimizeProcessorBinaryBase {
protected function executableName() {
return 'pngout';
}
public function applyToImage($image_uri) {
if ($cmd = $this
->getFullPathToBinary()) {
$dst = $this
->sanitizeFilename($image_uri);
if ($this
->getMimeType($image_uri) == 'image/png') {
$options = array();
$arguments = array(
$dst,
);
return $this
->execShellCommand($cmd, $options, $arguments);
}
}
return FALSE;
}
}
Classes
Name |
Description |
PngOut |
Uses the PngOut binary to optimize images. |