code: def exif_transpose(image):
      """
      If an image has an EXIF Orientation tag, return a new image that is
      transposed accordingly. Otherwise, return a copy of the image.
  
      :param image: The image to transpose.
      :return: An image.
      """
      exif = image.getexif()
      orientation = exif.get(0x0112)
      method = {
          2: Image.FLIP_LEFT_RIGHT,
          3: Image.ROTATE_180,
          4: Image.FLIP_TOP_BOTTOM,
          5: Image.TRANSPOSE,
          6: Image.ROTATE_270,
          7: Image.TRANSVERSE,
          8: Image.ROTATE_90,
      }.get(orientation)
      if method is not None:
          transposed_image = image.transpose(method)
          del exif[0x0112]
          transposed_image.info["exif"] = exif.tobytes()
          return transposed_image
      return image.copy()
  
imports: import functools
  import operator
  from .None import Image
  from ._util import isStringType
label_desc: Use image node_id 19 for calling a global function with example usage: exif_transpose(image) and returns: image, transposed_image