diff --git a/imgboard.php b/imgboard.php index 94ae2fd..e0257be 100644 --- a/imgboard.php +++ b/imgboard.php @@ -126,7 +126,7 @@ if (isset($_POST['message']) || isset($_POST['file'])) { $post['image_width'] = $file_info[0]; $post['image_height'] = $file_info[1]; - list($thumb_maxwidth, $thumb_maxheight) = thumbnailDimensions($post['image_width'], $post['image_height']); + list($thumb_maxwidth, $thumb_maxheight) = thumbnailDimensions($post); if (!createThumbnail($file_location, $thumb_location, $thumb_maxwidth, $thumb_maxheight)) { fancyDie("Could not create thumbnail."); diff --git a/inc/defines.php b/inc/defines.php index 3478041..12c99af 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -8,4 +8,6 @@ define('TINYIB_RESPAGE', true); // The following are provided for backward compatibility and should not be relied upon // Copy new settings from settings.default.php to settings.php if (!defined('TINYIB_MAXREPLIES')) { define('TINYIB_MAXREPLIES', 0); } +if (!defined('TINYIB_MAXWOP')) { define('TINYIB_MAXWOP', TINYIB_MAXW); } +if (!defined('TINYIB_MAXHOP')) { define('TINYIB_MAXHOP', TINYIB_MAXH); } ?> \ No newline at end of file diff --git a/inc/functions.php b/inc/functions.php index 02b0c1d..f0cb8f8 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -282,8 +282,15 @@ function checkDuplicateImage($hex) { } } -function thumbnailDimensions($width, $height) { - return ($width > TINYIB_MAXW || $height > TINYIB_MAXH) ? array(TINYIB_MAXW, TINYIB_MAXH) : array($width, $height); +function thumbnailDimensions($post) { + if ($post['parent'] == TINYIB_NEWTHREAD) { + $max_width = TINYIB_MAXWOP; + $max_height = TINYIB_MAXHOP; + } else { + $max_width = TINYIB_MAXW; + $max_height = TINYIB_MAXH; + } + return ($post['image_width'] > $max_width || $post['image_height'] > $max_height) ? array($max_width, $max_height) : array($post['image_width'], $post['image_height']); } function createThumbnail($name, $filename, $new_w, $new_h) { diff --git a/inc/html.php b/inc/html.php index 1e6f512..ce946e6 100644 --- a/inc/html.php +++ b/inc/html.php @@ -121,7 +121,10 @@ EOF; function buildPage($htmlposts, $parent, $pages=0, $thispage=0) { $managelink = basename($_SERVER['PHP_SELF']) . "?manage"; - $maxdimensions = TINYIB_MAXW . 'x' . TINYIB_MAXH; + $maxdimensions = TINYIB_MAXWOP . 'x' . TINYIB_MAXHOP; + if (TINYIB_MAXW != TINYIB_MAXWOP || TINYIB_MAXH != TINYIB_MAXHOP) { + $maxdimensions .= ' (new thread) or ' . TINYIB_MAXW . 'x' . TINYIB_MAXH . ' (reply)'; + } $maxfilesize = TINYIB_MAXKB * 1024; $postingmode = ""; @@ -239,9 +242,9 @@ EOF;