jpeg_quality

jpeg_quality

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

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('jpeg_quality') is found 2 times:

  • /wp-admin/includes/image-edit.php line 493
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    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
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
             *
             * @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;
        }
    }