Ticket #10613: 10613.diff

File 10613.diff, 633 bytes (added by dd32, 4 years ago)
Line 
1Index: wp-includes/media.php
2===================================================================
3--- wp-includes/media.php       (revision 11812)
4+++ wp-includes/media.php       (working copy)
5@@ -383,7 +383,7 @@
6                        return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
7        } else {
8                $rotated = false;
9-               if ( IMAGETYPE_JPEG == $orig_type ) {
10+               if ( IMAGETYPE_JPEG == $orig_type && function_exists('exif_read_data') ) {
11                        // rotate if EXIF 'Orientation' is set
12                        $exif = exif_read_data($file, null, true);
13                        if ( $exif && isset($exif['IFD0']) && is_array($exif['IFD0']) && isset($exif['IFD0']['Orientation']) ) {