Changeset 14649 for trunk/admin/include/configuration_sizes_process.inc.php
- Timestamp:
- May 2, 2012, 6:29:56 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/configuration_sizes_process.inc.php
r14221 r14649 98 98 $errors[$type]['w'] = '>0'; 99 99 } 100 100 101 101 $h = intval($pderivative['h']); 102 102 if ($h <= 0) … … 104 104 $errors[$type]['h'] = '>0'; 105 105 } 106 106 107 107 if (max($w,$h) <= $prev_w) 108 108 { … … 117 117 $errors[$type]['w'] = '>'.$prev_w; 118 118 } 119 119 120 120 $v = intval($pderivative['h']); 121 121 if ($v <= 0 or $v <= $prev_h) … … 124 124 } 125 125 } 126 126 127 127 if (count($errors) == 0) 128 128 { … … 130 130 $prev_h = intval($pderivative['h']); 131 131 } 132 133 $v = intval($pderivative['sharpen']); 134 if ($v<0 || $v>100) 135 { 136 $errors[$type]['sharpen'] = '[0..100]'; 137 } 132 138 } 133 139 … … 135 141 if (count($errors) == 0) 136 142 { 143 $quality_changed = ImageStdParams::$quality != intval($_POST['resize_quality']); 144 ImageStdParams::$quality = intval($_POST['resize_quality']); 145 137 146 $enabled = ImageStdParams::get_defined_type_map(); 138 147 $disabled = @unserialize( @$conf['disabled_derivatives'] ); … … 146 155 { 147 156 $pderivative = $pderivatives[$type]; 148 157 149 158 if ($pderivative['enabled']) 150 159 { … … 156 165 ) 157 166 ); 158 159 $new_params->quality = intval($_POST['resize_quality']); 160 167 $new_params->sharpen = intval($pderivative['sharpen']); 168 161 169 ImageStdParams::apply_global($new_params); 162 170 163 171 if (isset($enabled[$type])) 164 172 { … … 170 178 $same = false; 171 179 } 172 180 173 181 if ($same 174 182 and $new_params->sizing->max_crop != 0 … … 177 185 $same = false; 178 186 } 179 180 if ($new_params->quality != $old_params->quality) 187 188 if ($quality_changed 189 || $new_params->sharpen != $old_params->sharpen) 181 190 { 182 191 $same = false; 183 192 } 184 193 185 194 if (!$same) 186 195 { … … 210 219 } 211 220 } 212 221 213 222 $enabled_by = array(); // keys ordered by all types 214 223 foreach(ImageStdParams::get_all_types() as $type) … … 219 228 } 220 229 } 221 230 222 231 ImageStdParams::set_and_save($enabled_by); 223 232 if (count($disabled) == 0) … … 231 240 } 232 241 $conf['disabled_derivatives'] = serialize($disabled); 233 242 234 243 if (count($changed_types)) 235 244 { 236 245 clear_derivative_cache($changed_types); 237 246 } 238 247 239 248 array_push( 240 249 $page['infos'], … … 257 266 } 258 267 } 259 268 260 269 $template->assign('derivatives', $pderivatives); 261 270 $template->assign('ferrors', $errors);
Note: See TracChangeset
for help on using the changeset viewer.