diff --git src/wp-includes/class-wp-image-editor-gd.php src/wp-includes/class-wp-image-editor-gd.php
index 53f0837..f3833a8 100644
|
|
|
class WP_Image_Editor_GD extends WP_Image_Editor { |
| 124 | 124 | $this->update_size( $size[0], $size[1] ); |
| 125 | 125 | $this->mime_type = $size['mime']; |
| 126 | 126 | |
| | 127 | $exif = exif_read_data($this->file); |
| | 128 | if($exif) { |
| | 129 | $orientation = 0; |
| | 130 | |
| | 131 | if(!$orientation && isset($exif["Orientation"])) |
| | 132 | $orientation = $exif["Orientation"]; |
| | 133 | |
| | 134 | if(!$orientation && isset($exif["IFD0"]) && isset($exif["IFD0"]["Orientation"])) |
| | 135 | $orientation = $exif["IFD0"]["Orientation"]; |
| | 136 | |
| | 137 | if(!$orientation && isset($exif["COMPUTED"]) && isset($exif["COMPUTED"]["Orientation"])) |
| | 138 | $orientation = $exif["COMPUTED"]["Orientation"]; |
| | 139 | |
| | 140 | |
| | 141 | switch($orientation) { |
| | 142 | case 3: |
| | 143 | $this->rotate(180); |
| | 144 | break; |
| | 145 | case 6: |
| | 146 | $this->rotate(-90); |
| | 147 | break; |
| | 148 | case 8: |
| | 149 | $this->rotate(90); |
| | 150 | break; |
| | 151 | } |
| | 152 | } |
| | 153 | |
| 127 | 154 | return $this->set_quality(); |
| 128 | 155 | } |
| 129 | 156 | |