Check if EXIF extension is loaded, props dd32, fixes #10613

git-svn-id: http://svn.automattic.com/wordpress/trunk@11825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-08-16 04:50:10 +00:00
parent 954a1c3bac
commit 947807219e

View File

@ -383,7 +383,7 @@ function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $de
return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
} else {
$rotated = false;
if ( IMAGETYPE_JPEG == $orig_type ) {
if ( IMAGETYPE_JPEG == $orig_type && function_exists('exif_read_data') ) {
// rotate if EXIF 'Orientation' is set
$exif = exif_read_data($file, null, true);
if ( $exif && isset($exif['IFD0']) && is_array($exif['IFD0']) && isset($exif['IFD0']['Orientation']) ) {