In image_resize(), do not force the destination filename to *.jpg when we are dealing with a *.jpeg.
props SergeyBiryukov. fixes #16458. git-svn-id: https://develop.svn.wordpress.org/trunk@20701 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fcf7cda3c6
commit
26ff22c7a2
@ -462,7 +462,8 @@ function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $de
|
||||
return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
|
||||
} else {
|
||||
// all other formats are converted to jpg
|
||||
$destfilename = "{$dir}/{$name}-{$suffix}.jpg";
|
||||
if ( 'jpg' != $ext && 'jpeg' != $ext )
|
||||
$destfilename = "{$dir}/{$name}-{$suffix}.jpg";
|
||||
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