3 require_once "phpfspot_db.php";
4 require_once "phpfspot.class.php";
11 public function __construct()
13 $this->parent = new PHPFSPOT;
14 $this->db = $this->parent->db;
18 public function __destruct()
23 public function show($idx, $width = "")
25 $details = $this->parent->get_photo_details($idx);
27 foreach(Array($this->parent->cfg->thumb_width, $this->parent->cfg->photo_width) as $resolution)
28 $this->parent->resize_image($this->parent->translate_path($details['directory_path']) ."/". $details['name'], $resolution);
31 $fullpath = $this->parent->translate_path($details['directory_path']) ."/". $details['name'];
33 $fullpath = $this->parent->translate_path($details['directory_path']) ."/thumbs/". $width ."_". $details['name'];
36 $tmp = getimagesize($fullpath);
39 Header("Content-Type: ". $mime);
40 Header("Content-Length: ". filesize($fullpath));
41 Header("Content-Transfer-Encoding: binary\n");
42 $user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
43 Header("Content-Disposition: inline; filename=\"". $details['name'] ."\"");
44 Header("Accept-Ranges: bytes");
45 Header("Connection: close");
47 $file = fopen($fullpath, "rb");
55 if(isset($_GET['idx']) && is_numeric($_GET['idx'])) {
57 if(isset($_GET['width']) && is_numeric($_GET['width']))
58 $width = $_GET['width'];
62 $img = new PHPFSPOT_IMG;
63 $img->show($_GET['idx'], $width);