From 4d3add1686c222596f2875b71f77cdd587e42b16 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 6 Aug 2007 14:41:37 +0000 Subject: two fixes git-svn-id: file:///svn/phpbb/trunk@8011 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 4b38919e81..9e7449cd50 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -652,11 +652,23 @@ function create_thumbnail($source, $destination, $mimetype) if ($type['version'] == 1) { $new_image = imagecreate($new_width, $new_height); + + if ($new_image === false) + { + return false; + } + imagecopyresized($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); } else { $new_image = imagecreatetruecolor($new_width, $new_height); + + if ($new_image === false) + { + return false; + } + imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); } -- cgit v1.2.1