$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);
} // 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'];
/* 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);
}
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";
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'];