retro/lib/Preview/Rom.php
Michel Roux 02bc3602e2
All checks were successful
retro / xml (push) Successful in 25s
retro / php (push) Successful in 57s
retro / nodejs (push) Successful in 59s
retro / release (push) Has been skipped
chore: ⬆️ update vite and start working on preview
2025-01-10 23:49:33 +01:00

32 lines
632 B
PHP

<?php
declare(strict_types=1);
namespace OCA\Retro\Preview;
use OCP\Files\File;
use OCP\Files\FileInfo;
use OCP\IImage;
use OCP\Image;
use OCP\Preview\IProviderV2;
abstract class Rom implements IProviderV2
{
protected string $console;
public function getMimeType(): string {
return sprintf('/application\/x-%s-rom/', $this->console);
}
public function isAvailable(FileInfo $file): bool {
return file_exists(sprintf('%s/../../assets/%s.png', __DIR__, $this->console));
}
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
$image = new Image();
$image->loadFromFile();
return null;
}
}