/** * show Image to client * @since: 5.0 * @moved from image_view.class.php */ private static function outputImage($filepath) { $info = RevSliderFunctions::getPathInfo($filepath); $ext = $info["extension"]; $ext = strtolower($ext); if ($ext == "jpg") { $ext = "jpeg"; } $numExpires = 31536000; //one year $strExpires = @date('D, d M Y H:i:s', time() + $numExpires); $contents = file_get_contents($filepath); $filesize = strlen($contents); header("Expires: {$strExpires} GMT"); header("Cache-Control: public"); header("Content-Type: image/{$ext}"); header("Content-Length: {$filesize}"); echo $contents; exit; }