forked from leftypol/leftypol
30 lines
712 B
PHP
30 lines
712 B
PHP
<?php
|
|
namespace Vichan\Service\Media;
|
|
|
|
use Vichan\Data\ThumbGenerationResult;
|
|
|
|
|
|
interface MediaHandler {
|
|
public function supportsMime(string $mime): bool;
|
|
|
|
public function openHandle(string $file_path, string $file_mime): mixed;
|
|
|
|
/**
|
|
* Generates a thumbnail from the given file.
|
|
*
|
|
* @param string $source_file_path
|
|
* @param string $source_file_mime
|
|
* @param string $preferred_out_file_path
|
|
* @param string $preferred_out_mime
|
|
* @param int $max_width
|
|
* @param int $max_height
|
|
* @return ThumbGenerationResult
|
|
*/
|
|
public function generateThumb(
|
|
mixed $handle,
|
|
string $preferred_out_file_path,
|
|
string $preferred_out_mime,
|
|
int $max_width,
|
|
int $max_height
|
|
): ThumbGenerationResult;
|
|
}
|