summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 948a87e..e0fba5f 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,10 +360,15 @@ 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) {
$full_path = $this->translate_path($details['directory_path']) ."/". $details['name'];
@@ -381,8 +386,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);
}