$user = new User($session->get_user_id()); $session_valid_array = $session->is_valid(); if ($session_valid_array[0] === true) { try { $image_cache = new ImageCache($_GET['file_id']); } catch (Exception $e) { die("Exception"); } if ($_GET['max_width']) { $image_cache->set_max_width($_GET['max_width']); } if ($_GET['max_height']) { $image_cache->set_max_height($_GET['max_height']); } if ($_GET['width']) { $file_path = constant("BASE_DIR") . "/filesystem/temp/" . $image_cache->get_image($_GET['width']); } elseif ($_GET['height']) { $file_path = constant("BASE_DIR") . "/filesystem/temp/" . $image_cache->get_image(null, $_GET['height']); } else { $file_path = constant("BASE_DIR") . "/filesystem/temp/" . $image_cache->get_image(); } if (!$file_path) { $file_path = constant("WWW_DIR") . "/images/access.jpg"; } } else { $file_path = constant("WWW_DIR") . "/images/access.jpg"; } } else { $file_path = constant("WWW_DIR") . "/images/access.jpg"; } $image = new Imagick($file_path);