mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 20:32:14 +09:00
파일이나 확장자가 이미지, 오디오, 동영상이며, MIME 타입이 전혀 다른 경우에만 확장자를 고치도록 수정
direct가 아닌 첨부파일 본문 삽입시의 오류 수정 이미지, 오디오, 동영상 MIME 타입을 mime_content_type()의 반환값으로 수정
This commit is contained in:
parent
ac9141b4f2
commit
6db830c4c4
9 changed files with 122 additions and 100 deletions
|
|
@ -63,11 +63,20 @@ class Image
|
|||
{
|
||||
return false;
|
||||
}
|
||||
$img_type = [
|
||||
IMG_GIF => 'gif',
|
||||
IMG_JPG => 'jpg',
|
||||
// jpeg is the same as jpg
|
||||
IMG_PNG => 'png',
|
||||
IMG_WEBP => 'webp',
|
||||
IMG_WBMP => 'wbmp',
|
||||
IMG_XPM => 'xpm',
|
||||
(defined('IMG_BMP') ? IMG_BMP : 64) => 'bmp',
|
||||
];
|
||||
return [
|
||||
'width' => $image_info[0],
|
||||
'height' => $image_info[1],
|
||||
'type' => image_type_to_extension($image_info[2], false),
|
||||
'mime' => $image_info['mime'],
|
||||
'type' => $img_type[$image_info[2]],
|
||||
'bits' => $image_info['bits'] ?? null,
|
||||
'channels' => $image_info['channels'] ?? null,
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue