func DecodeConfig(r io.Reader) (image.Config, string, error) {
	orientation, r := getOrientation(r)
	cfg, format, err := image.DecodeConfig(r)
	if err != nil {
		return cfg, format, err
	}
	if orientation >= 5 && orientation <= 8 {
		cfg.Width, cfg.Height = cfg.Height, cfg.Width
	}
	return cfg, format, nil
}
DecodeConfig decodes the color model and dimensions of an image
with the respect to the EXIF orientation tag (if present).

Note that after using imageorient.Decode on the same image,
the color model of the decoded image may be different if the
orientation-related transformation is needed.
package imageorient
import (
	"bytes"
	"encoding/binary"
	"image"
	"io"
	"io/ioutil"
	"github.com/disintegration/gift"
)
const maxBufLen = 1 << 20
func Decode(r io.Reader) (image.Image, string, error) {
	orientation, r := getOrientation(r)
	img, format, err := image.Decode(r)
	if err != nil {
		return img, format, err
	}
	return fixOrientation(img, orientation), format, nil
}