aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/derivative.inc.php2
-rw-r--r--include/derivative_params.inc.php11
2 files changed, 12 insertions, 1 deletions
diff --git a/include/derivative.inc.php b/include/derivative.inc.php
index d19b5a1b8..b89e39e3b 100644
--- a/include/derivative.inc.php
+++ b/include/derivative.inc.php
@@ -197,7 +197,7 @@ final class DerivativeImage
{
if ( $src->has_size() && $params->is_identity( $src->get_size() ) )
{
- if (!$params->use_watermark && !$src->rotation)
+ if (!$params->will_watermark($src->get_size()) && !$src->rotation)
{
$params = null;
$rel_path = $rel_url = $src->rel_path;
diff --git a/include/derivative_params.inc.php b/include/derivative_params.inc.php
index 3128e5fb2..b29255c53 100644
--- a/include/derivative_params.inc.php
+++ b/include/derivative_params.inc.php
@@ -281,5 +281,16 @@ final class DerivativeParams
}
return true;
}
+
+ function will_watermark($out_size)
+ {
+ if ($this->use_watermark)
+ {
+ $min_size = ImageStdParams::get_watermark()->min_size;
+ return $min_size[0]<=$out_size[0]
+ && $min_size[1]<=$$out_size[1];
+ }
+ return false;
+ }
}
?> \ No newline at end of file