WordPress.org

Make WordPress Core

Changeset 10682


Ignore:
Timestamp:
03/02/2009 09:55:40 PM (9 years ago)
Author:
westi
Message:

Allow a plugin to change the jpeg image quality. Fixes #9245 props filosofo.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/image.php

    r10150 r10682  
    6969    $dst_file = preg_replace( '/\\.[^\\.]+$/', '.jpg', $dst_file );
    7070
    71     if ( imagejpeg( $dst, $dst_file ) )
     71    if ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) )
    7272        return $dst_file;
    7373    else
  • trunk/wp-includes/media.php

    r10498 r10682  
    379379        // all other formats are converted to jpg
    380380        $destfilename = "{$dir}/{$name}-{$suffix}.jpg";
    381         if (!imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality ) ) )
     381        if (!imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) )
    382382            return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
    383383    }
Note: See TracChangeset for help on using the changeset viewer.