|
|
|
@ -623,6 +623,8 @@ function createThumbnail($file_location, $thumb_location, $new_w, $new_h, $spoil
@@ -623,6 +623,8 @@ function createThumbnail($file_location, $thumb_location, $new_w, $new_h, $spoil
|
|
|
|
|
$src_img = imagecreatefrompng($file_location); |
|
|
|
|
} else if (preg_match("/gif/", $system[0])) { |
|
|
|
|
$src_img = imagecreatefromgif($file_location); |
|
|
|
|
} else if (preg_match("/avif/", $system[0])) { |
|
|
|
|
$src_img = imagecreatefromavif($file_location); |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -663,6 +665,10 @@ function createThumbnail($file_location, $thumb_location, $new_w, $new_h, $spoil
@@ -663,6 +665,10 @@ function createThumbnail($file_location, $thumb_location, $new_w, $new_h, $spoil
|
|
|
|
|
if (!imagegif($dst_img, $thumb_location)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} else if (preg_match("/avif/", $system[0])) { |
|
|
|
|
if (!imageavif($dst_img, $thumb_location)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
imagedestroy($dst_img); |
|
|
|
@ -906,7 +912,7 @@ function attachFile($post, $filepath, $filename, $uploaded, $spoiler) {
@@ -906,7 +912,7 @@ function attachFile($post, $filepath, $filename, $uploaded, $spoiler) {
|
|
|
|
|
$post['file_size_formatted'] = convertBytes($post['file_size']); |
|
|
|
|
checkDuplicateFile($post['file_hex']); |
|
|
|
|
|
|
|
|
|
if (in_array($file_mime, array('image/jpeg', 'image/pjpeg', 'image/png', 'image/gif', 'application/x-shockwave-flash'))) { |
|
|
|
|
if (in_array($file_mime, array('image/jpeg', 'image/pjpeg', 'image/png', 'image/gif', 'application/x-shockwave-flash', 'image/avif', 'image/heif'))) { |
|
|
|
|
$file_info = getimagesize($file_src); |
|
|
|
|
$post['image_width'] = $file_info[0] != '' ? $file_info[0] : 0; |
|
|
|
|
$post['image_height'] = $file_info[1] != '' ? $file_info[1] : 0; |
|
|
|
@ -922,7 +928,7 @@ function attachFile($post, $filepath, $filename, $uploaded, $spoiler) {
@@ -922,7 +928,7 @@ function attachFile($post, $filepath, $filename, $uploaded, $spoiler) {
|
|
|
|
|
if ($file_mime == 'application/x-shockwave-flash') { |
|
|
|
|
addVideoOverlay('thumb/' . $post['thumb']); |
|
|
|
|
} |
|
|
|
|
} else if (in_array($file_mime, array('image/jpeg', 'image/pjpeg', 'image/png', 'image/gif'))) { |
|
|
|
|
} else if (in_array($file_mime, array('image/jpeg', 'image/pjpeg', 'image/png', 'image/gif', 'image/avif', 'image/heif'))) { |
|
|
|
|
$post['thumb'] = $file_name_pre . 's.' . $tinyib_uploads[$file_mime][0]; |
|
|
|
|
list($thumb_maxwidth, $thumb_maxheight) = thumbnailDimensions($post); |
|
|
|
|
|
|
|
|
|