From 06c86f519db030b30b30d02a962b92f41f1b8c42 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 2 May 2012 20:58:57 +0000 Subject: [PATCH] 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: http://core.svn.wordpress.org/trunk@20701 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 63cdfbda8..a6af7f7f8 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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' )); }