Allow a plugin to change the jpeg image quality. Fixes #9245 props filosofo.
git-svn-id: https://develop.svn.wordpress.org/trunk@10682 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5b4d3c536d
commit
0560f26f76
@ -68,7 +68,7 @@ function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_
|
||||
|
||||
$dst_file = preg_replace( '/\\.[^\\.]+$/', '.jpg', $dst_file );
|
||||
|
||||
if ( imagejpeg( $dst, $dst_file ) )
|
||||
if ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) )
|
||||
return $dst_file;
|
||||
else
|
||||
return false;
|
||||
|
@ -378,7 +378,7 @@ function image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_p
|
||||
else {
|
||||
// all other formats are converted to jpg
|
||||
$destfilename = "{$dir}/{$name}-{$suffix}.jpg";
|
||||
if (!imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality ) ) )
|
||||
if (!imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) )
|
||||
return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user