Ignore:
Timestamp:
May 2, 2012, 6:29:56 AM (12 years ago)
Author:
rvelices
Message:

multi size:

  • fix external imagick issues when rotation was required
  • fix: derivative were generated continuosly until a first save performed in the admin screen
  • added sharpen param in the new config screen
  • increased the sharpen range (10% is less than before)
File:
1 edited

Legend:

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

    r14221 r14649  
    9898      $errors[$type]['w'] = '>0';
    9999    }
    100    
     100
    101101    $h = intval($pderivative['h']);
    102102    if ($h <= 0)
     
    104104      $errors[$type]['h'] = '>0';
    105105    }
    106    
     106
    107107    if (max($w,$h) <= $prev_w)
    108108    {
     
    117117      $errors[$type]['w'] = '>'.$prev_w;
    118118    }
    119    
     119
    120120    $v = intval($pderivative['h']);
    121121    if ($v <= 0 or $v <= $prev_h)
     
    124124    }
    125125  }
    126  
     126
    127127  if (count($errors) == 0)
    128128  {
     
    130130    $prev_h = intval($pderivative['h']);
    131131  }
     132
     133  $v = intval($pderivative['sharpen']);
     134  if ($v<0 || $v>100)
     135  {
     136    $errors[$type]['sharpen'] = '[0..100]';
     137  }
    132138}
    133139
     
    135141if (count($errors) == 0)
    136142{
     143  $quality_changed = ImageStdParams::$quality != intval($_POST['resize_quality']);
     144  ImageStdParams::$quality = intval($_POST['resize_quality']);
     145
    137146  $enabled = ImageStdParams::get_defined_type_map();
    138147  $disabled = @unserialize( @$conf['disabled_derivatives'] );
     
    146155  {
    147156    $pderivative = $pderivatives[$type];
    148    
     157
    149158    if ($pderivative['enabled'])
    150159    {
     
    156165          )
    157166        );
    158      
    159       $new_params->quality = intval($_POST['resize_quality']);
    160      
     167      $new_params->sharpen = intval($pderivative['sharpen']);
     168
    161169      ImageStdParams::apply_global($new_params);
    162      
     170
    163171      if (isset($enabled[$type]))
    164172      {
     
    170178          $same = false;
    171179        }
    172        
     180
    173181        if ($same
    174182            and $new_params->sizing->max_crop != 0
     
    177185          $same = false;
    178186        }
    179        
    180         if ($new_params->quality != $old_params->quality)
     187
     188        if ($quality_changed
     189            || $new_params->sharpen != $old_params->sharpen)
    181190        {
    182191          $same = false;
    183192        }
    184        
     193
    185194        if (!$same)
    186195        {
     
    210219    }
    211220  }
    212  
     221
    213222  $enabled_by = array(); // keys ordered by all types
    214223  foreach(ImageStdParams::get_all_types() as $type)
     
    219228    }
    220229  }
    221  
     230
    222231  ImageStdParams::set_and_save($enabled_by);
    223232  if (count($disabled) == 0)
     
    231240  }
    232241  $conf['disabled_derivatives'] = serialize($disabled);
    233  
     242
    234243  if (count($changed_types))
    235244  {
    236245    clear_derivative_cache($changed_types);
    237246  }
    238  
     247
    239248  array_push(
    240249    $page['infos'],
     
    257266    }
    258267  }
    259  
     268
    260269  $template->assign('derivatives', $pderivatives);
    261270  $template->assign('ferrors', $errors);
Note: See TracChangeset for help on using the changeset viewer.