diff --git a/core/ext/image.ext.php b/core/ext/image.ext.php index 6f975ab4..ed97c2a0 100644 --- a/core/ext/image.ext.php +++ b/core/ext/image.ext.php @@ -117,7 +117,9 @@ class ImageIO extends Extension { $memory_limit = get_memory_limit(); if($memory_use > $memory_limit) { - $thumb = imagecreatetruecolor($max_width, min($max_height, 64)); + $w = $config->get_int('thumb_width'); + $h = $config->get_int('thumb_height'); + $thumb = imagecreatetruecolor($w, min($h, 64)); $white = imagecolorallocate($thumb, 255, 255, 255); $black = imagecolorallocate($thumb, 0, 0, 0); imagefill($thumb, 0, 0, $white); @@ -147,12 +149,12 @@ class ImageIO extends Extension { /* * Check for an existing image */ - if($row = $this->is_dupe($image->hash)) { - $iid = $row['id']; - $page->add_main_block(new Block( - "Error uploading {$image->filename}", - "Image $iid ". - "already has hash {$image->hash}")); + $existing = $database->get_image_by_hash($image->hash); + if(!is_null($existing)) { + $page->add_main_block(new Block("Error uploading {$image->filename}", + "Image {$existing->id} ". + "already has hash {$image->hash}:

". + build_thumb_html($existing))); return false; } diff --git a/ext/regen_thumb.ext.php b/ext/regen_thumb.ext.php index 291f5141..4c84c505 100644 --- a/ext/regen_thumb.ext.php +++ b/ext/regen_thumb.ext.php @@ -87,7 +87,9 @@ class RegenThumb extends Extension { $memory_limit = get_memory_limit(); if($memory_use > $memory_limit) { - $thumb = imagecreatetruecolor($max_width, min($max_height, 64)); + $w = $config->get_int('thumb_width'); + $h = $config->get_int('thumb_height'); + $thumb = imagecreatetruecolor($w, min($h, 64)); $white = imagecolorallocate($thumb, 255, 255, 255); $black = imagecolorallocate($thumb, 0, 0, 0); imagefill($thumb, 0, 0, $white);