aboutsummaryrefslogtreecommitdiffstats
path: root/include/derivative.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-01-17 06:09:32 +0000
committerrvelices <rv-github@modusoptimus.com>2012-01-17 06:09:32 +0000
commite693ef60cd8f79e11ae4de3ba2f7494a72fc35c2 (patch)
treedb901414e97e48d4830d53af6c676fe5373da3ef /include/derivative.inc.php
parentb18e3c8a803b15fc72f95791072220afb23f46bf (diff)
feature 2548 multisize - ability to choose displayed size on index page
-added some logs on i.php (configurable) to measure the perf git-svn-id: http://piwigo.org/svn/trunk@12908 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/derivative.inc.php12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/derivative.inc.php b/include/derivative.inc.php
index d15e7eff3..1f5152dd3 100644
--- a/include/derivative.inc.php
+++ b/include/derivative.inc.php
@@ -100,8 +100,6 @@ final class DerivativeImage
public $src_image;
- private $requested_type;
-
private $flags = 0;
private $params;
private $rel_path, $rel_url;
@@ -111,12 +109,10 @@ final class DerivativeImage
$this->src_image = $src_image;
if (is_string($type))
{
- $this->requested_type = $type;
$this->params = ImageStdParams::get_by_type($type);
}
else
{
- $this->requested_type = IMG_CUSTOM;
$this->params = $type;
}
@@ -125,14 +121,12 @@ final class DerivativeImage
static function thumb_url($infos)
{
- $src_image = new SrcImage($infos);
- self::build($src_image, ImageStdParams::get_by_type(IMG_THUMB), $rel_path, $rel_url);
- return get_root_url().$rel_url;
+ return self::url(IMG_THUMB, $infos);
}
static function url($type, $infos)
{
- $src_image = new SrcImage($infos);
+ $src_image = is_object($infos) ? $infos : new SrcImage($infos);
$params = is_string($type) ? ImageStdParams::get_by_type($type) : $type;
self::build($src_image, $params, $rel_path, $rel_url);
return get_root_url().$rel_url;
@@ -257,7 +251,7 @@ final class DerivativeImage
$size = $this->get_size();
if ($size)
{
- return 'width="'.$size[0].'" height="'.$size[1].'"';
+ return 'width='.$size[0].' height='.$size[1];
}
}