oc-resizer-plugin/compressors/Compressor.php

28 lines
532 B
PHP

<?php
namespace Aweos\Resizer\Compressors;
abstract class Compressor
{
abstract function make(string $path): array;
abstract protected function getExtension();
public function tmpPath(): string
{
return "/tmp/".str_slug(microtime());
}
protected function versionFilename(string $source, $width, $height): string
{
return pathinfo($source, PATHINFO_FILENAME).
'-'.
$width.
'x'.
$height.
'.'.$this->getExtension();
}
}