summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-06-09 07:08:46 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-06-09 07:08:46 +0000
commitc54dcf670a6ea58d885eb143c0eac8d90d3020f7 (patch)
treeffcb1971d7023b0440d3996f29af989596971c84 /phpfspot.class.php
parenta8f486923b8243347ac658a9a7148939f6c0411d (diff)
additional resolution for bubble images
image viewer class now uses parents thumbnail handling functions git-svn-id: file:///var/lib/svn/phpfspot/trunk@68 fa6a889d-dae6-447d-9e79-4ba9a3039384
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 ."&amp;width=200";
+ $image_url = "phpfspot_img.php?idx=". $photo ."&amp;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);
}