          if not with_metadata:
              retval = cv2.imread(filename)
              if retval is None:
                  raise ValueError("Image is None")
          else:
              with open(filename, "rb") as infile:
                  raw_file = infile.read()
                  metadata = png_read_meta(raw_file)
              image = cv2.imdecode(np.frombuffer(raw_file, dtype="uint8"), cv2.IMREAD_UNCHANGED)
              retval = (image, metadata)
      except TypeError as err:
          success = False
 
</s> remove             image = cv2.imdecode(np.frombuffer(raw_file, dtype="uint8"), cv2.IMREAD_UNCHANGED)
            retval = (image, metadata)
 </s> add                 retval = (image, metadata)
            else:
                retval = image </s> remove         if not with_metadata:
            retval = cv2.imread(filename)
            if retval is None:
 </s> add         with open(filename, "rb") as infile:
            raw_file = infile.read()
            image = cv2.imdecode(np.frombuffer(raw_file, dtype="uint8"), cv2.IMREAD_UNCHANGED)
            if image is None:
            if with_metadata:
          if not with_metadata:
              retval = cv2.imread(filename)
              if retval is None:
                  raise ValueError("Image is None")
            if with_metadata:
            if with_metadata:
            if with_metadata:
                  metadata = png_read_meta(raw_file)
              image = cv2.imdecode(np.frombuffer(raw_file, dtype="uint8"), cv2.IMREAD_UNCHANGED)
              retval = (image, metadata)
      except TypeError as err:
          success = False
keep keep keep keep replace replace replace keep keep keep keep keep
 bugfix: error loading images with special chars 
lib/image.py