Changeset 17230


Ignore:
Timestamp:
Jul 30, 2012, 10:01:17 PM (8 years ago)
Author:
rvelices
Message:

bug 2712: Custom sized derivatives are never sharpened

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/i.php

    r17229 r17230  
    300300  {
    301301    if (!isset($original_size))
    302       return; // cannot really know if a watermark is required
     302      return false; // cannot really know if a watermark is required
    303303    $dsize = $params->compute_final_size($original_size);
    304304    $use_watermark = $params->will_watermark($dsize);
     
    347347    $page['src_url'] = $page['root_path'] . substr($candidate_path, strlen(PHPWG_ROOT_PATH));
    348348    $page['rotation_angle'] = 0;
    349   }
     349                return true;
     350  }
     351        return false;
    350352}
    351353
     
    516518mysql_close($pwg_db_link);
    517519
    518 try_switch_source($params, $src_mtime);
     520if (!try_switch_source($params, $src_mtime) && $params->type==IMG_CUSTOM)
     521{
     522        $sharpen = 0;
     523        foreach (ImageStdParams::get_defined_type_map() as $std_params)
     524        {
     525                $sharpen += $std_params->sharpen;
     526        }
     527        $params->sharpen = round($sharpen / count(ImageStdParams::get_defined_type_map()) );
     528}
    519529
    520530if (!mkgetdir(dirname($page['derivative_path'])))
Note: See TracChangeset for help on using the changeset viewer.