From 66c8ad501f643f3d9daf7710e815d00d6a56039c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Jul 2014 22:13:19 +0000 Subject: [PATCH] Add exif `orientation` to data extracted in `wp_read_image_metadata()`. Props shanebp. Fixes 28916. git-svn-id: https://develop.svn.wordpress.org/trunk@29291 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/image.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index 7e8b6eefe7..b78bac2a56 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -273,6 +273,7 @@ function wp_read_image_metadata( $file ) { 'iso' => 0, 'shutter_speed' => 0, 'title' => '', + 'orientation' => 0, ); /* @@ -389,6 +390,9 @@ function wp_read_image_metadata( $file ) { if ( ! empty( $exif['ExposureTime'] ) ) { $meta['shutter_speed'] = (string) wp_exif_frac2dec( $exif['ExposureTime'] ); } + if ( ! empty( $exif['Orientation'] ) ) { + $meta['orientation'] = $exif['Orientation']; + } } foreach ( array( 'title', 'caption', 'credit', 'copyright', 'camera', 'iso' ) as $key ) {