Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1177623
D311.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Oct 8, 10:31 AM
Size
743 B
Mime Type
text/x-diff
Expires
Thu, Oct 9, 10:31 AM (2 h, 6 m)
Engine
blob
Format
Raw Data
Handle
764184
Attached To
D311: INP-1708 - Ignore crop/fill parameters during image resize, when they have no effect
D311.diff
View Options
Index: branches/5.2.x/core/units/helpers/image_helper.php
===================================================================
--- branches/5.2.x/core/units/helpers/image_helper.php
+++ branches/5.2.x/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
Log In to Comment