3 require_once "phpfspot.class.php";
10 public function __construct()
12 $this->parent = new PHPFSPOT;
13 $this->db = $this->parent->db;
17 public function __destruct()
22 public function show($idx, $width = 0)
24 $this->parent->gen_thumb($idx);
26 $details = $this->parent->get_photo_details($idx);
29 $fullpath = $this->parent->translate_path($details['directory_path']) ."/". $details['name'];
32 $fullpath = $this->parent->translate_path($details['directory_path']) ."/thumbs/". $width ."_". $details['name'];
35 $tmp = getimagesize($fullpath);
38 Header("Content-Type: ". $mime);
39 Header("Content-Length: ". filesize($fullpath));
40 Header("Content-Transfer-Encoding: binary\n");
41 Header("Content-Disposition: inline; filename=\"". $details['name'] ."\"");
42 Header("Accept-Ranges: bytes");
43 Header("Connection: close");
45 $file = fopen($fullpath, "rb");
53 if(isset($_GET['idx']) && is_numeric($_GET['idx'])) {
55 if(isset($_GET['width']) && is_numeric($_GET['width']))
56 $width = $_GET['width'];
60 $img = new PHPFSPOT_IMG;
61 $img->show($_GET['idx'], $width);