Description
This ticket is for tracking a follow-up patch that updates the existing smart image cropping functionality with refinements aimed at improving performance.
Acceptance Criteria
Crops continue to respect defined aspect ratios.
New cropping logic applies automatically
QA validation confirms results remain stable across a representative set of sample images.
Notes:
This enhancement builds on the current implementation. Please review for consistency and verify that it integrates cleanly with existing pipelines.
QA steps
- test with network throttled to "slow 4G" setting to ensure that image download-to-display time is more reasonable (should be much shorter due to not waiting for a full-resolution image download)
- test images of various aspect ratios to ensure they scale and crop as expected
- very wide images are most likely to look different as they will be "stretched" much more than before
Requirement
Scope: Smart Image Cropping (desktop + mobile).
- Updated cropping logic must improve performance while preserving correct aspect ratios.
- Cropping results must remain stable across sample images.
- Enhancement must integrate seamlessly with existing cropping pipeline.
- On slow networks, image display must be faster since it should not wait for full-resolution image downloads.
- Wide images must still crop and scale correctly (no broken aspect ratios).
BDD
Feature: Enhanced smart image cropping performance
Scenario: Faster image load under poor network conditions
Given I am on a slow network connection
When an image is displayed with smart cropping enabled
Then the image loads and displays quickly without waiting for full-resolution download
And the crop respects the defined aspect ratio
Scenario: Stable cropping results across images
Given I have a set of sample images with varying aspect ratios
When each image is displayed with smart cropping enabled
Then the crop respects the defined aspect ratio
And the subject remains centered consistently
Scenario: Wide image handling
Given I view a very wide panoramic image
When it is displayed with smart cropping enabled
Then the image scales and crops correctly
And no broken or distorted aspect ratios occurTest Steps
Test Case 1: Performance on throttled network
- Enable network throttling in DevTools (Slow 4G).
- Open a page with images using smart cropping.
- AC1: Images display quickly without waiting for full-resolution files.
- AC2: Cropping respects the defined aspect ratio.
Test Case 2: Stability across various aspect ratios
- Load sample images in portrait, landscape, and square aspect ratios.
- AC3: Each image respects its aspect ratio in the cropped result.
- AC4: Main subject remains centered.
Test Case 3: Wide image handling
- Load a very wide panoramic image.
- AC5: Image scales correctly to fit viewport.
- AC6: Cropping preserves correct aspect ratio without distortion.
QA Results - Patchdemo
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T404378#11226950 |
| 2 | ✅ | T404378#11226950 |
| 3 | ✅ | T404378#11226950 |
| 4 | ✅ | T404378#11226950 |
| 5 | ✅ | T404378#11226950 |
| 6 | ✅ | T404378#11226950 |


