[wp-trac] [WordPress Trac] #54648: Improve filter to enable setting quality for each subsize image
WordPress Trac
noreply at wordpress.org
Wed Oct 30 20:10:20 UTC 2024
#54648: Improve filter to enable setting quality for each subsize image
-------------------------------------+-------------------------------------
Reporter: Mte90 | Owner: adamsilverstein
Type: enhancement | Status: accepted
Priority: normal | Milestone: 6.8
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit- | Focuses: performance,
tests changes-requested | sustainability
-------------------------------------+-------------------------------------
Comment (by sppramodh):
## Test Report
### Description
This report evaluates the functionality of setting specific quality levels
for image sub-size, ensuring that images over 1000 pixels are compressed
to quality level 5, while smaller images retain default quality settings.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/2189
### Environment
- WordPress: 6.8-alpha-59319
- PHP: 8.2.18
- Server: Apache/2.4.59 (Win64) PHP/8.2.18 mod_fcgid/2.3.10-dev
- Database: mysqli (Server: 8.3.0 / Client: mysqlnd 8.2.18)
- Browser: Chrome 130.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.0
- MU Plugins: None activated
- Image editor: WP_Image_Editor_GD version : bundled (2.1.0 compatible)
- Plugins:
* Test Reports 1.1.0
* Images to WebP
### Actual Results
- Uploaded an original image in multiple formats (JPEG, WebP, and HDPI)
with various dimensions.
- Verified that images with dimensions exceeding 1000 pixels were
processed with a quality setting of 5
- Confirmed that images under 1000 pixels retained the default quality
settings.
- Checked quality consistency across image conversions from JPEG to
WebP
✅ The patch works as expected.
### Additional Notes
- The last argument, $size, in wp_editor_set_quality() was occasionally
passed as an object instead of an array when processing the original
uploaded image.
- This behavior was logged, debug logs (See attached debug logs for
further detail).
### Supplemental Artifacts
Original Image:
https://wordpress.org/photos/photo/175671ce8d/
Compressed Image with Quality 5
https://imgur.com/9McZwIf
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54648#comment:39>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list