parent
04cbe54dd1
commit
220c0ece82
18 changed files with 95 additions and 22 deletions
|
|
@ -6,6 +6,14 @@ final class ImageService
|
|||
{
|
||||
private const ALLOWED = ['image/jpeg' => 'jpg', 'image/png' => 'png', 'image/webp' => 'webp', 'image/gif' => 'gif'];
|
||||
|
||||
public static function processor(): ?string
|
||||
{
|
||||
if (self::magickBinary() !== null) {
|
||||
return 'ImageMagick';
|
||||
}
|
||||
return extension_loaded('gd') ? 'GD' : null;
|
||||
}
|
||||
|
||||
public static function inspect(string $path, int $maxBytes = 20_000_000): array
|
||||
{
|
||||
if (!is_file($path) || filesize($path) > $maxBytes) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue