diff --git a/index.php b/index.php index e2373b9..bb66679 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,7 @@ $GLOBALS['config']['defaultThumbSize'] = '120x90'; // default size for thumbnail $GLOBALS['config']['onlyThumb'] = TRUE; // generate only thumbnail or generate thumbnail + 1280x1024 image -$GLOBALS['config']['thumbSize'] = array(1 => '100x80', '120x90', '200x160', '300x240', '400x320', '500x400'); +$GLOBALS['config']['thumbSize'] = array('s' => '120x90', 'm' => '200x160', 'l' => '300x240', 'xl' => '400x320', 'xxl' => '500x400'); // list of available size for thumb if (!file_exists('cache/config/genConf.php')) { @@ -233,7 +233,7 @@ if ($_GET) { } $defUrl = $ui['url']; - if (isset($ui['s']) && (int)$ui['s']) { + if (isset($ui['s']) && array_key_exists($ui['s'], $GLOBALS['config']['thumbSize'])) { $width = $GLOBALS['config']['thumbSize'][$ui['s']]; } else { $width = $GLOBALS['config']['defaultThumbSize']; @@ -282,7 +282,7 @@ if ($_POST) { $defUrl = $ui['url']; - if (isset($ui['s']) && (int)$ui['s']) { + if (isset($ui['s']) && array_key_exists($ui['s'], $GLOBALS['config']['thumbSize'])) { $width = $GLOBALS['config']['thumbSize'][$ui['s']]; } else { $width = $GLOBALS['config']['defaultThumbSize']; @@ -347,7 +347,7 @@ if (empty($width)) { '; - echo ''; + echo ''; echo '

'; if ($GLOBALS['config']['onlyThumb'] === false) { echo '

';