code: public static function getOrientation($fileName)
      {
          $orientation = 1; // Fallback to "straight"
          $metadata = static::getMetadata($fileName);
          if (isset($metadata['Orientation'])) {
              $orientation = $metadata['Orientation'];
          }
          return $orientation;
      }
docs: Returns the EXIF orientation of a given picture.
  
  @param string $fileName
  @return integer