Skip to content

Commit

Permalink
Add support for the separate 'Orientation' field in EXIF
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Jan 17, 2025
1 parent 1021b7c commit 8dafdb1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wcfsetup/install/files/lib/util/ExifUtil.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,12 @@ public static function getOrientation(array $exifData)
$orientation = self::ORIENTATION_ORIGINAL;
if (isset($exifData['IFD0']['Orientation'])) {
$orientation = \intval($exifData['IFD0']['Orientation']);
if ($orientation < self::ORIENTATION_ORIGINAL || $orientation > self::ORIENTATION_270_ROTATE) {
$orientation = self::ORIENTATION_ORIGINAL;
}
} else if (isset($exifData['Orientation'])) {
$orientation = \intval($exifData['Orientation']);
}

if ($orientation < self::ORIENTATION_ORIGINAL || $orientation > self::ORIENTATION_270_ROTATE) {
$orientation = self::ORIENTATION_ORIGINAL;
}

return $orientation;
Expand Down

0 comments on commit 8dafdb1

Please sign in to comment.