+
+ if(!$details) {
+ $this->parent->showTextImage("The image (". $idx .") you requested is unknown");
+ return;
+ }
+
+ /* no width specified - show photo in its original size */
+ if($width == 0) {
+ $fullpath = $this->parent->translate_path($this->parent->parse_uri($details['uri'], 'fullpath'));
+ }
+ /* show thumbnail */
+ else {
+ /* if no entry for this photo is yet in the database, create thumb */
+ if(!$this->parent->getMD5($idx)) {
+ $this->parent->gen_thumb($idx);
+ }
+ $fullpath = $this->parent->get_thumb_path($width, $idx);
+ /* if the thumb file does not exist, create it */
+ if(!file_exists($fullpath)) {
+ $this->parent->gen_thumb($idx);
+ }
+ }
+
+ if(!file_exists($fullpath)) {
+ $this->parent->showTextImage("File ". basename($fullpath) ." does not exist");
+ return;
+ }
+ if(!is_readable($fullpath)) {
+ $this->parent->showTextImage("File ". basename($fullpath) ." is not readable. Check the permissions");
+ return;
+ }
+ $mime = $this->parent->get_mime_info($fullpath);
+
+ if(!$this->parent->checkifImageSupported($mime)) {
+ $this->parent->showTextImage("Unsupported Image Type");
+ return;
+ }