Changeset 59588 for trunk/src/wp-includes/class-wp-image-editor-imagick.php
- Timestamp:
- 01/07/2025 09:04:35 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-imagick.php
r59473 r59588 504 504 } 505 505 506 // Limit the bit depth of resized images to 8 bits per channel.506 // Limit the bit depth of resized images. 507 507 if ( is_callable( array( $this->image, 'getImageDepth' ) ) && is_callable( array( $this->image, 'setImageDepth' ) ) ) { 508 if ( 8 < $this->image->getImageDepth() ) { 509 $this->image->setImageDepth( 8 ); 510 } 508 /** 509 * Filters the maximum bit depth of resized images. 510 * 511 * This filter only applies when resizing using the Imagick editor since GD 512 * does not support getting or setting bit depth. 513 * 514 * Use this to adjust the maximum bit depth of resized images. 515 * 516 * @since 6.8.0 517 * 518 * @param int $max_depth The maximum bit depth. Default is the input depth. 519 * @param int $image_depth The bit depth of the original image. 520 */ 521 $max_depth = apply_filters( 'image_max_bit_depth', $this->image->getImageDepth(), $this->image->getImageDepth() ); 522 $this->image->setImageDepth( $max_depth ); 511 523 } 512 524 } catch ( Exception $e ) {
Note: See TracChangeset
for help on using the changeset viewer.