X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=3f7a7280253b04cdd44110ee3188ee7560610882;hp=948a87e56fb3cd9463e5bab647e3093fcfcb027e;hb=a2d560dc04f13fbd08e9ce9a6f254103555e69ac;hpb=a8f486923b8243347ac658a9a7148939f6c0411d diff --git a/phpfspot.class.php b/phpfspot.class.php index 948a87e..3f7a728 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -262,7 +262,7 @@ class PHPFSPOT { $details = $this->get_photo_details($photo); - $image_url = "phpfspot_img.php?idx=". $photo ."&width=200"; + $image_url = "phpfspot_img.php?idx=". $photo ."&width=". $this->cfg->bubble_width; $filesize = filesize($this->translate_path($details['directory_path']) ."/". $details['name']); $filesize = rand($filesize/1024, 2); @@ -360,16 +360,22 @@ class PHPFSPOT { } // check_config_table - public function gen_thumbs($fromcmd = 0) + public function gen_thumbs($idx = 0, $fromcmd = 0) { - /* get all available photos */ - $all = $this->getAllTagPhotos(); + if(!$idx) { + /* get all available photos */ + $all = $this->getAllTagPhotos(); + } + else + $all = Array($idx); + foreach($all as $photo) { + $details = $this->get_photo_details($photo); + $full_path = $this->translate_path($details['directory_path']) ."/". $details['name']; $file_md5 = md5_file($full_path); - $details = $this->get_photo_details($photo); if($fromcmd) print "Image ". $details['name'] ." Thumbnails:"; /* if the file hasn't changed there is no need to regen the thumb */ @@ -381,8 +387,14 @@ class PHPFSPOT { /* set the new/changed MD5 sum for the current photo */ $this->setMD5($photo, $file_md5); + $resolutions = Array( + $this->cfg->thumb_width, + $this->cfg->bubble_width, + $this->cfg->photo_width + ); + /* create thumbnails for the requested resolutions */ - foreach(Array($this->cfg->thumb_width, $this->cfg->photo_width) as $resolution) { + foreach($resolutions as $resolution) { if($fromcmd) print " ". $resolution ."px"; $this->create_thumbnail($full_path, $resolution); }