mirror of
https://github.com/friendica/friendica
synced 2025-05-06 19:44:09 +02:00
API: The legacy API finally moved
This commit is contained in:
parent
8abf1dccf0
commit
95f085b7ac
22 changed files with 1161 additions and 1391 deletions
|
@ -46,6 +46,30 @@ class Images
|
|||
return $m;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return file extension for mime type
|
||||
* @param string $mimetype
|
||||
* @return string
|
||||
*/
|
||||
public static function getExtensionByMimeType(string $mimetype): string
|
||||
{
|
||||
switch ($mimetype) {
|
||||
case 'image/png':
|
||||
$imagetype = IMAGETYPE_PNG;
|
||||
break;
|
||||
|
||||
case 'image/gif':
|
||||
$imagetype = IMAGETYPE_GIF;
|
||||
break;
|
||||
|
||||
default:
|
||||
$imagetype = IMAGETYPE_JPEG;
|
||||
break;
|
||||
}
|
||||
|
||||
return image_type_to_extension($imagetype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns supported image mimetypes and corresponding file extensions
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue