@ -631,6 +631,43 @@ function createThumbnail($file_location, $thumb_location, $new_w, $new_h) {
}
}
if (!$spoiler) {
return true;
}
if (preg_match("/jpg|jpeg/", $system[0])) {
$src_img = imagecreatefromjpeg($thumb_location);
} else if (preg_match("/png/", $system[0])) {
$src_img = imagecreatefrompng($thumb_location);
} else if (preg_match("/gif/", $system[0])) {
$src_img = imagecreatefromgif($thumb_location);
} else {
return true;
}
if (!$src_img) {
fancyDie(__('Unable to read the uploaded file while creating its thumbnail. A common cause for this is an incorrect extension when the file is actually of a different type.'));