forked from leftypol/leftypol
ThumbGenerator: broaden scop to media handler
This commit is contained in:
parent
5f85ca7f44
commit
f3ce9bf055
3 changed files with 4 additions and 5 deletions
|
@ -4,7 +4,7 @@ namespace Vichan\Service\Media;
|
|||
use Vichan\Data\ThumbGenerationResult;
|
||||
|
||||
|
||||
class FallbackThumbGenerator implements ThumbGenerator {
|
||||
class FallbackMediaHandler implements MediaHandler {
|
||||
private string $path;
|
||||
private int $width;
|
||||
private int $height;
|
|
@ -5,7 +5,7 @@ use Vichan\Data\ThumbGenerationResult;
|
|||
use Vichan\Functions\Fs;
|
||||
|
||||
|
||||
class GdThumbGenerator implements ThumbGenerator {
|
||||
class GdMediaHandler implements MediaHandler {
|
||||
private const PHP81 = \PHP_MAJOR_VERSION >= 8 && \PHP_MINOR_VERSION >= 1;
|
||||
|
||||
private const MIME_TO_EXT = [
|
|
@ -4,7 +4,7 @@ namespace Vichan\Service\Media;
|
|||
use Vichan\Data\ThumbGenerationResult;
|
||||
|
||||
|
||||
interface ThumbGenerator {
|
||||
interface MediaHandler {
|
||||
public function supportsMime(string $mime): bool;
|
||||
|
||||
/**
|
||||
|
@ -19,8 +19,7 @@ interface ThumbGenerator {
|
|||
* @return ThumbGenerationResult
|
||||
*/
|
||||
public function generateThumb(
|
||||
string $source_file_path,
|
||||
string $source_file_mime,
|
||||
mixed $handle,
|
||||
string $preferred_out_file_path,
|
||||
string $preferred_out_mime,
|
||||
int $max_width,
|
Loading…
Add table
Add a link
Reference in a new issue