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 $details = $this->parent->get_photo_details($idx);
27 $this->parent->showTextImage("The image you requested is unknown");
31 /* show original photo */
33 $fullpath = $this->parent->translate_path($details['directory_path']) ."/". $details['name'];
37 $fullpath = $this->parent->cfg->base_path ."/thumbs/". $width ."_". $this->parent->getMD5($idx);
38 if(!file_exists($fullpath))
39 $this->parent->gen_thumb($idx, 0, 1);
42 if(!file_exists($fullpath)) {
43 $this->parent->showTextImage("test1");
46 if(!is_readable($fullpath)) {
47 $this->parent->showTextImage("File ". $fullpath ." is not readable. Check the permissions");
51 $tmp = getimagesize($fullpath);
54 Header("Content-Type: ". $mime);
55 Header("Content-Length: ". filesize($fullpath));
56 Header("Content-Transfer-Encoding: binary\n");
57 Header("Content-Disposition: inline; filename=\"". $details['name'] ."\"");
58 Header("Accept-Ranges: bytes");
59 Header("Connection: close");
61 $file = fopen($fullpath, "rb");
69 if(isset($_GET['idx']) && is_numeric($_GET['idx'])) {
71 if(isset($_GET['width']) && is_numeric($_GET['width']))
72 $width = $_GET['width'];
76 $img = new PHPFSPOT_IMG;
77 $img->show($_GET['idx'], $width);