mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 00:01:21 +00:00
Add png support for samples and previews
This commit is contained in:
@@ -442,6 +442,20 @@ class MediaExtractionService
|
||||
return exif_imagetype($filePath) === IMAGETYPE_JPEG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if file is a valid image (JPEG or PNG).
|
||||
*/
|
||||
public function isValidImage(string $filePath): bool
|
||||
{
|
||||
if (! File::isFile($filePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$type = @exif_imagetype($filePath);
|
||||
|
||||
return $type === IMAGETYPE_JPEG || $type === IMAGETYPE_PNG;
|
||||
}
|
||||
|
||||
private function ffmpeg(): FFMpeg
|
||||
{
|
||||
if ($this->ffmpeg === null) {
|
||||
|
||||
Reference in New Issue
Block a user