Changeset 59473 for trunk/src/wp-includes/class-wp-image-editor.php
- Timestamp:
- 11/29/2024 11:46:50 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor.php
r59406 r59473 241 241 * 242 242 * @since 3.5.0 243 * 244 * @param int $quality Compression Quality. Range: [1,100] 243 * @since 6.8.0 The `$dims` parameter was added. 244 * 245 * @param int $quality Compression Quality. Range: [1,100] 246 * @param array $dims Optional. Image dimensions array with 'width' and 'height' keys. 245 247 * @return true|WP_Error True if set successfully; WP_Error on failure. 246 */ 247 public function set_quality( $quality = null ) { 248 249 */ 250 public function set_quality( $quality = null, $dims = array() ) { 248 251 // Use the output mime type if present. If not, fall back to the input/initial mime type. 249 252 $mime_type = ! empty( $this->output_mime_type ) ? $this->output_mime_type : $this->mime_type; … … 261 264 * 262 265 * @since 3.5.0 266 * @since 6.8.0 Added the size parameter. 263 267 * 264 268 * @param int $quality Quality level between 1 (low) and 100 (high). 265 269 * @param string $mime_type Image mime type. 270 * @param array $size { 271 * Dimensions of the image. 272 * 273 * @type int $width The image width. 274 * @type int $height The image height. 275 * } 266 276 */ 267 $quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type );277 $quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type, $dims ? $dims : $this->size ); 268 278 269 279 if ( 'image/jpeg' === $mime_type ) {
Note: See TracChangeset
for help on using the changeset viewer.