22 lines
599 B
PHP
22 lines
599 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Shared\Application\Contracts;
|
|
|
|
/**
|
|
* Turns an uploaded image into upright, downscaled JPEGs without metadata
|
|
* (no location), for task images and stock item images.
|
|
*/
|
|
interface ImageResizer
|
|
{
|
|
/**
|
|
* JPEG versions of the image whose longer side is at most each of the
|
|
* given sizes, or null when the file is not a readable image.
|
|
*
|
|
* @param list<int> $maxSizes
|
|
* @return list<array{bytes: string, width: int, height: int}>|null
|
|
*/
|
|
public function jpegVersions(string $path, array $maxSizes): ?array;
|
|
}
|