jpeg_quality

jpeg_quality

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.6.2

apply_filters('jpeg_quality') is found 2 times:

  • /wp-admin/includes/image-edit.php line 493
     
    		switch ( $mime_type ) {
    			case 'image/jpeg':
    				/** This filter is documented in wp-includes/class-wp-image-editor.php */
    				return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) );
    			case 'image/png':
    				return imagepng( $image, $filename );
    			case 'image/gif':
    				return imagegif( $image, $filename );
    			case 'image/webp':
    				if ( function_exists( 'imagewebp' ) ) {
    
  • /wp-includes/class-wp-image-editor.php line 286
    				 *
    				 * @param int    $quality Quality level between 0 (low) and 100 (high) of the JPEG.
    				 * @param string $context Context of the filter.
    				 */
    				$quality = apply_filters( 'jpeg_quality', $quality, 'image_resize' );
    			}
    
    			if ( $quality < 0 || $quality > 100 ) {
    				$quality = $default_quality;
    			}
    		}