app/Http/Controllers/EditMediaController.php
private function createMediaFileGedcom(string $file, string $type, string $title): string
    {
        if (preg_match('/\.([a-z0-9]+)/i', $file, $match)) {
            $extension = strtolower($match[1]);
            $extension = str_replace('jpg', 'jpeg', $extension);
            $extension = ' ' . $extension;
        } else {
            $extension = '';
        }

        $gedcom = '1 FILE ' . $file;
        if ($type !== '') {
            $gedcom .= "\n2 FORM" . $extension . "\n3 TYPE " . $type;
        }
        if ($title !== '') {
            $gedcom .= "\n2 TITL " . $title;
        }

        return $gedcom;
    }
private function createMediaFileGedcom(string $file, string $type, string $title): string
    {
        if (preg_match('/\.([a-z0-9]+)/i', $file, $match)) {
            $extension = strtolower($match[1]);
            $extension = str_replace('jpg', 'jpeg', $extension);
            $extension = ' ' . $extension;
        } else {
            $extension = '';
        }

        $gedcom = '1 FILE ' . $file;
        if ($type !== '') {
            $gedcom .= "\n2 FORM" . $extension . "\n3 TYPE " . $type;
        }
        if ($title !== '') {
            $gedcom .= "\n2 TITL " . $title;
        }

        return $gedcom;
    }
private function createMediaFileGedcom ( string $ file , string $ type , string $ title ) : string { if ( preg_match ( '/\.([a-z0-9]+)/i' , $ file , $ match ) ) { $ extension = strtolower ( $ match [ 1 ] ) ; $ extension = str_replace ( 'jpg' , 'jpeg' , $ extension ) ; $ extension = ' ' . $ extension ; } else { $ extension = '' ; } $ gedcom = '1 FILE ' . $ file ; if ( $ type !== '' ) { $ gedcom .= "\n2 FORM" . $ extension . "\n3 TYPE " . $ type ; } if ( $ title !== '' ) { $ gedcom .= "\n2 TITL " . $ title ; } return $ gedcom ; }
Convert the media file attributes into GEDCOM format.

@param string $file
@param string $type
@param string $title

@return string
Convert the media file attributes into GEDCOM format .