$h) { $ratio = $w/$h; $new_width = $MAX; $new_height = (int)($MAX/$ratio); } else { $ratio = $h/$w; $new_height = $MAX; $new_width = (int)($MAX/$ratio); } $scaled = imagecreatetruecolor($new_width, $new_height); imagecopyresampled($scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $infos[0], $infos[1]); header('Content-Type: image/jpeg'); imagejpeg($scaled); } if (isset($_GET['f'])) { $f = ABS_PATH . IMAGES_DIR . $_GET['f']; if ( strpos ($f, '..') !== false) return; if (file_exists($f)) { thumb_send($f); } } exit(); ?>