additional resolution for bubble images
authorAndreas Unterkircher <unki@netshadow.at>
Sat, 9 Jun 2007 07:08:46 +0000 (07:08 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Sat, 9 Jun 2007 07:08:46 +0000 (07:08 +0000)
image viewer class now uses parents thumbnail handling functions

git-svn-id: file:///var/lib/svn/phpfspot/trunk@68 fa6a889d-dae6-447d-9e79-4ba9a3039384

gen_thumbs.php
phpfspot.class.php
phpfspot_cfg.php
phpfspot_img.php

index 1912a54b8f3a44deb02ee154e872090573f72f39..46c10d7f4642989c5a13f586c9d4d8565e4d82b3 100755 (executable)
@@ -4,6 +4,6 @@
 require_once "phpfspot.class.php";
 
 $fspot = new PHPFSPOT;
 require_once "phpfspot.class.php";
 
 $fspot = new PHPFSPOT;
-$fspot->gen_thumbs('fromcmd');
+$fspot->gen_thumbs(0, 'fromcmd');
 
 ?>
 
 ?>
index 948a87e56fb3cd9463e5bab647e3093fcfcb027e..e0fba5f8cb5bc7a06b00c5f83b4f6c3f8b57472e 100644 (file)
@@ -262,7 +262,7 @@ class PHPFSPOT {
 
       $details = $this->get_photo_details($photo);
 
 
       $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);
 
       $filesize = filesize($this->translate_path($details['directory_path'])  ."/". $details['name']);
       $filesize = rand($filesize/1024, 2);
@@ -360,10 +360,15 @@ class PHPFSPOT {
 
    } // check_config_table
 
 
    } // 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'];
       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);
 
          /* 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 */
          /* 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);
          }
             if($fromcmd) print " ". $resolution ."px";
             $this->create_thumbnail($full_path, $resolution);
          }
index ee05eac91e4f8bdb6722c30d807dbdaa03a5ffaf..34257cd5b60b2c3da89bf613c3ffcbb003932f19 100644 (file)
@@ -12,7 +12,7 @@ class PHPFSPOT_CFG {
    var $web_path = "/phpfspot";
 
    var $thumb_width = "150";
    var $web_path = "/phpfspot";
 
    var $thumb_width = "150";
-   
+   var $bubble_width = "200";
    var $photo_width = "640";
 
    var $fspot_db = "/var/www/images.netshadow.at/htdocs/phpfspot/photos.db";
    var $photo_width = "640";
 
    var $fspot_db = "/var/www/images.netshadow.at/htdocs/phpfspot/photos.db";
index 4bafa42bbf8a3ef6c1b532b6a5395bb8e7f4042e..e2e0325eb2271b288b01db982d529e091c679e2f 100644 (file)
@@ -22,10 +22,7 @@ class PHPFSPOT_IMG {
 
    public function show($idx, $width = "")
    {
 
    public function show($idx, $width = "")
    {
-      $details = $this->parent->get_photo_details($idx);
-
-      foreach(Array($this->parent->cfg->thumb_width, $this->parent->cfg->photo_width) as $resolution)
-         $this->parent->create_thumbnail($this->parent->translate_path($details['directory_path'])  ."/". $details['name'], $resolution);
+      $this->parent->gen_thumbs($idx);
 
       if($width == "")
          $fullpath = $this->parent->translate_path($details['directory_path'])  ."/". $details['name'];
 
       if($width == "")
          $fullpath = $this->parent->translate_path($details['directory_path'])  ."/". $details['name'];