code: func exifOrientation(r io.Reader) (int, FlipDirection) {
  	var (
  		angle    int
  		flipMode FlipDirection
  	)
  	ex, err := exif.Decode(r)
  	if err != nil {
  		imageDebug("No valid EXIF; will not rotate or flip.")
  		return 0, 0
  	}
  	tag, err := ex.Get(exif.Orientation)
  	if err != nil {
  		imageDebug(`No "Orientation" tag in EXIF; will not rotate or flip.`)
  		return 0, 0
  	}
  	orient, err := tag.Int(0)
  	if err != nil {
  		imageDebug(fmt.Sprintf("EXIF error: %v", err))
  		return 0, 0
  	}
  	switch orient {
  	case topLeftSide:
  		// do nothing
  	case topRightSide:
  		flipMode = 2
  	case bottomRightSide:
  		angle = 180
  	case bottomLeftSide:
  		angle = 180
  		flipMode = 2
  	case leftSideTop:
  		angle = -90
  		flipMode = 2
  	case rightSideTop:
  		angle = -90
  	case rightSideBottom:
  		angle = 90
  		flipMode = 2
  	case leftSideBottom:
  		angle = 90
  	}
  	return angle, flipMode
  }
docs: // exifOrientation parses the  EXIF data in r and returns the stored
  // orientation as the angle and flip necessary to transform the image.