          The :func:`hashlib.hexdigest()` representation of the `sha1` hash of the given image.
      Example
      -------
      >>> image_file = "/path/to/image.png"
      >>> image_hash = read_image_hash(image_file)
      """
      img = read_image(filename, raise_error=True)
      retval = sha1(img).hexdigest()
      if output_shape:
          retval = (retval, img.shape)
 
</s> remove     str
        The :func:`hashlib.hexdigest()` representation of the `sha1` hash of the given image.
 </s> add     dict
        The output dictionary will contain the `width` and `height` of the png image as well as any
        `itxt` information. </s> remove     img = read_image(filename, raise_error=True)
    retval = sha1(img).hexdigest()
    if output_shape:
        retval = (retval, img.shape)
    logger.trace("filename: '%s', retval: %s", filename, retval)
 </s> add     retval = dict()
    if os.path.splitext(filename)[-1] != ".png":
        raise ValueError(f"Only png files are supported for reading exif data. ({filename})")
    with open(filename, "rb") as infile:
        chunk = infile.read(8)
        if chunk != b"\x89PNG\r\n\x1a\n":
            raise ValueError(f"Invalid header found in png: {filename}")
        while True:
            chunk = infile.read(8)
            length, field = struct.unpack(">I4s", chunk)
            logger.trace("Read chunk: (chunk: %s, length: %s, field: %s", chunk, length, field)
            if not chunk or field == b"IDAT":
                break
            if field == b"IHDR":
                # Get dimensions
                chunk = infile.read(8)
                retval["width"], retval["height"] = struct.unpack(">II", chunk)
                length -= 8
            elif field == b"iTXt":
                retval["itxt"] = eval(infile.read(length).split(b"\0\0\0\0\0", 1)[-1])
                break
            infile.seek(length + 4, 1)
    logger.trace("filename: %s, metadata: %s", filename, retval) </s> remove     tuple: (`filename`, :func:`hashlib.hexdigest()` representation of the `sha1` hash of the image,
            [optional shape tuple] )
 </s> add     tuple
        (**filename** (`str`), **metadata** (`dict`) )
 </s> remove     encoded_image = cv2.imencode(extension, image)[1]
    image_hash = sha1(cv2.imdecode(encoded_image, cv2.IMREAD_UNCHANGED)).hexdigest()
    return image_hash, encoded_image
 </s> add     pointer = png.find(b"iTXt") - 4
    if pointer < 0:
        logger.trace("No metadata in png")
        return None
    length = struct.unpack(">I", png[pointer:pointer + 4])[0]
    pointer += 8
    data = png[pointer:pointer + length].split(b"\0\0\0\0\0", 1)[-1]
    return eval(data) </s> remove     >>>    image = read_image(image_file, raise_error=True, with_hash=False)
 </s> add     >>>    image = read_image(image_file, raise_error=True, with_metadata=False)
    >>> metadata = read_image_meta(image_file)
    >>> width = metadata["width]
    >>> height = metadata["height"]
    >>> faceswap_info = metadata["itxt"]
          The :func:`hashlib.hexdigest()` representation of the `sha1` hash of the given image.
      Example
      -------
      >>> image_file = "/path/to/image.png"
    >>> metadata = read_image_meta(image_file)
    >>> width = metadata["width]
    >>> height = metadata["height"]
    >>> faceswap_info = metadata["itxt"]
      """
      img = read_image(filename, raise_error=True)
      retval = sha1(img).hexdigest()
      if output_shape:
          retval = (retval, img.shape)
keep keep keep keep replace keep keep keep keep keep
 Update extracted faces to use PNG EXIF data (#1123)

Documentation
  - Update Usage.md, align.rst and image.rst
lib.image.py
  - read_image - Remove hash return, add metadata return
  - Remove read_image_hash functions
  - Add read_image_meta functios
  - Replace encode_image_with_hash with encode_image (to store metadata)
  - Add png meta reading and writing functions
  - Update Image Loaders/Savers to handle metadata rather than hashes
lib.training_data
  - Naming updates to remove references to hashes
lib.align.Alignments
  - Add versioning notes
  - Increment alignments version to 2.1
  - Deprecate hashing lookup functions
  - Replace filter_hashes with filter_faces
lib.align.detected_face
  - DetectedFace
    - Remove hash property
    - Add png header data serializing/deserializing functions
  - Mask
    - Add png header data serializing/deserializing functions
  - add update_legacy_png_header function to update png meta data
lib.cli.args - Deprecate alignments files for training
- plugins.train.trainer
  - Update alignments/mask code to read png header data
- scripts.convert
  - Aligned images folder - read data from png headers
- scripts.extract
  - Write png header information and no longer store hash of face
- tools.alignments
  - remove leftover-faces, merge and update-hashes jobs
  - Update jobs to use png meta data rather than hashes
- tools.manual
  - Update extract code to output png meta data and don't store hashes
  - Perform check on launch that tool is not pointing at a faces folder
tools.mask
  - Update to use png meta data
tools.sort
  - Update to use png meta data 
lib/image.py