mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
bug 2682: Watermark sizing calculation is made on the requested size not on the final one
git-svn-id: http://piwigo.org/svn/trunk@16989 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user