<?php

declare(strict_types=1);

namespace App\Domain\Media;

enum ImageFormat: string
{
    case AVIF = 'avif';
    case WEBP = 'webp';
    case JPEG = 'jpeg';

    public function getMimeType(): string
    {
        return match ($this) {
            self::AVIF => 'image/avif',
            self::WEBP => 'image/webp',
            self::JPEG => 'image/jpeg',
        };
    }

    public function getQuality(): int
    {
        return match ($this) {
            self::AVIF => 80,
            self::WEBP => 85,
            self::JPEG => 85,
        };
    }
}
