. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use Fisharebest\Webtrees\Services\MediaFileService; use function strtoupper; /** * MULTIMEDIA_FORMAT := {Size=3:4} * [ bmp | gif | jpg | ole | pcx | tif | wav ] * Indicates the format of the multimedia data associated with the specific * GEDCOM context. This allows processors to determine whether they can process * the data object. Any linked files should contain the data required, in the * indicated format, to process the file data. */ class MultimediaFormat extends AbstractElement { protected const SUBTAGS = [ 'TYPE' => '0:1', ]; /** * Convert a value to a canonical form. * * @param string $value * * @return string */ public function canonical(string $value): string { $value = strtoupper(parent::canonical($value)); return MediaFileService::EXTENSION_TO_FORM[$value] ?? $value; } }