. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; 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', ]; // GEDCOM uses the abbreviated versions of these extensions protected const EXTENSIONS = [ 'JPEG' => 'JPG', 'TIFF' => 'TIF', ]; /** * Convert a value to a canonical form. * * @param string $value * * @return string */ public function canonical(string $value): string { $value = strtoupper(parent::canonical($value)); return self::EXTENSIONS[$value] ?? $value; } }