[-] Core: The emails can now be sent with amazon SES when logo is in png
This commit is contained in:
@@ -410,4 +410,33 @@ class ImageManagerCore
|
||||
@chmod($filename, 0664);
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the mime type by the file extension
|
||||
*
|
||||
* @param string $file_name
|
||||
* @return string
|
||||
*/
|
||||
public static function getMimeTypeByExtension($file_name)
|
||||
{
|
||||
$types = array(
|
||||
'image/gif' => array('gif'),
|
||||
'image/jpeg' => array('jpg', 'jpeg'),
|
||||
'image/png' => array('jpg', 'png')
|
||||
);
|
||||
$extension = substr($file_name, strrpos($file_name, '.') + 1);
|
||||
|
||||
$mime_type = null;
|
||||
foreach ($types as $mime => $exts)
|
||||
if (in_array($extension, $exts))
|
||||
{
|
||||
$mime_type = $mime;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($mime_type === null)
|
||||
$mime_type = 'image/jpeg';
|
||||
|
||||
return $mime_type;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user