Page MenuHomeIn-Portal Phabricator

D311.id750.diff
No OneTemporary

File Metadata

Created
Sun, Sep 28, 6:33 PM

D311.id750.diff

Index: core/units/helpers/image_helper.php
===================================================================
--- core/units/helpers/image_helper.php
+++ core/units/helpers/image_helper.php
@@ -123,6 +123,15 @@
$params['max_height'] = $params['target_height'];
}
+ // Optimize, because when cropping from center without resize we'll get same image back.
+ if ( !$needs_resize
+ && isset($params['crop_x'])
+ && $params['crop_x'] == 'c'
+ && $params['crop_y'] == 'c'
+ ) {
+ unset($params['crop_x'], $params['crop_y'], $params['fill']);
+ }
+
$src_path = dirname($src_image);
$transform_keys = Array ('crop_x', 'crop_y', 'fill', 'wm_filename');

Event Timeline