Ignore:
Timestamp:
Aug 1, 2012, 9:03:17 PM (8 years ago)
Author:
rvelices
Message:

merge-r17295 from branch 2.4 feature 2708: in admin, display allowed custom derivatives and ability to delete them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/configuration_watermark_process.inc.php

    r14584 r17302  
    4949
    5050    $new_name = get_filename_wo_extension($_FILES['watermarkImage']['name']).'.png';
    51     $file_path = $upload_dir.'/'.$new_name; 
    52  
     51    $file_path = $upload_dir.'/'.$new_name;
     52
    5353    move_uploaded_file($_FILES['watermarkImage']['tmp_name'], $file_path);
    54    
     54
    5555    $pwatermark['file'] = substr($file_path, strlen(PHPWG_ROOT_PATH));
    5656  }
     
    135135  // do we have to regenerate the derivatives (and which types)?
    136136  $changed_types = array();
    137  
     137
    138138  foreach (ImageStdParams::get_defined_type_map() as $type => $params)
    139139  {
     
    141141    ImageStdParams::apply_global($params);
    142142
    143     if ($params->use_watermark != $old_use_watermark
    144         or $params->use_watermark and $watermark_changed)
     143    $changed = $params->use_watermark != $old_use_watermark;
     144    if (!$changed and $params->use_watermark)
     145    {
     146      $changed = $watermark_changed;
     147    }
     148    if (!$changed and $params->use_watermark)
     149    {
     150      // if thresholds change and before/after the threshold is lower than the corresponding derivative side -> some derivatives might switch the watermark
     151      $changed |= $watermark->min_size[0]!=$old_watermark->min_size[0] and ($watermark->min_size[0]<$params->max_width() or $old_watermark->min_size[0]<$params->max_width());
     152      $changed |= $watermark->min_size[1]!=$old_watermark->min_size[1] and ($watermark->min_size[1]<$params->max_height() or $old_watermark->min_size[1]<$params->max_height());
     153    }
     154
     155    if ($changed)
    145156    {
    146157      $params->last_mod_time = time();
Note: See TracChangeset for help on using the changeset viewer.