Changeset 16989


Ignore:
Timestamp:
Jul 24, 2012, 10:49:31 PM (8 years ago)
Author:
rvelices
Message:

bug 2682: Watermark sizing calculation is made on the requested size not on the final one

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/i.php

    r16072 r16989  
    105105    header('Content-Location: '.$url);
    106106    header('Location: '.$url);
     107    ilog('WARN', $code, $url, $_SERVER['REQUEST_URI']);
    107108    exit;
    108109  }
     
    204205    preg_match($conf['sync_chars_regex'], $token) or ierror('Invalid chars in request', 400);
    205206  }
    206  
     207
    207208  $page['derivative_path'] = PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$req;
    208209
     
    453454  WHERE path=\''.$page['src_location'].'\'
    454455;';
    455    
     456
    456457    if ( ($row=pwg_db_fetch_assoc(pwg_query($query))) )
    457458    {
     
    465466      {
    466467        $page['rotation_angle'] = pwg_image::get_rotation_angle($page['src_path']);
    467        
     468
    468469        single_update(
    469470          $prefixeTable.'images',
     
    541542}
    542543
    543 if ($params->use_watermark)
     544if ($params->will_watermark($d_size))
    544545{
    545546  $wm = ImageStdParams::get_watermark();
  • trunk/include/derivative.inc.php

    r16508 r16989  
    198198    if ( $src->has_size() && $params->is_identity( $src->get_size() ) )
    199199    {
    200       if (!$params->use_watermark && !$src->rotation)
     200      if (!$params->will_watermark($src->get_size()) && !$src->rotation)
    201201      {
    202202        $params = null;
  • trunk/include/derivative_params.inc.php

    r14649 r16989  
    282282    return true;
    283283  }
     284 
     285  function will_watermark($out_size)
     286  {
     287    if ($this->use_watermark)
     288    {
     289      $min_size = ImageStdParams::get_watermark()->min_size;
     290      return $min_size[0]<=$out_size[0]
     291        && $min_size[1]<=$$out_size[1];
     292    }
     293    return false;
     294  }
    284295}
    285296?>
Note: See TracChangeset for help on using the changeset viewer.