Add png support for samples and previews

This commit is contained in:
DariusIII
2026-01-09 14:00:36 +01:00
parent ef3c3cfafa
commit cb2a4345bd
2 changed files with 58 additions and 41 deletions
@@ -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) {