      def load_disk_frames(self):
          """ Load frames from disk """
          logger.debug("Input is separate Frames. Loading images")
          for filename in self.input_images:
              logger.trace("Loading image: '%s'", filename)
              try:
                  image = cv2.imread(filename)  # pylint: disable=no-member
              except Exception as err:  # pylint: disable=broad-except
                  logger.error("Failed to load image '%s'. Original Error: %s", filename, err)
                  continue
              yield filename, image
  
      def load_video_frames(self):
          """ Return frames from a video file """
 
</s> remove             image = cv2.imread(src)  # pylint: disable=no-member
 </s> add             image = cv2_read_img(src, raise_error=True) </s> remove             retval = cv2.imread(filename)  # pylint: disable=no-member
 </s> add             retval = cv2_read_img(filename, raise_error=True) </s> remove         try:
            image = cv2.imread(filename)  # pylint: disable=no-member
        except TypeError:
            raise Exception("Error while reading image", filename)

 </s> add         image = cv2_read_img(filename, raise_error=True) </s> remove     img = cv2.imread(filename)  # pylint: disable=no-member
 </s> add     img = cv2_read_img(filename, raise_error=True) </s> remove         image = cv2.imread(filename)
 </s> add         image = cv2_read_img(filename, raise_error=True)
            image = cv2_read_img(filename, raise_error=False)
            if image is None:
      def load_disk_frames(self):
          """ Load frames from disk """
          logger.debug("Input is separate Frames. Loading images")
          for filename in self.input_images:
            image = cv2_read_img(filename, raise_error=False)
            if image is None:
            image = cv2_read_img(filename, raise_error=False)
            if image is None:
            image = cv2_read_img(filename, raise_error=False)
            if image is None:
            image = cv2_read_img(filename, raise_error=False)
            if image is None:
            image = cv2_read_img(filename, raise_error=False)
            if image is None:
                  continue
              yield filename, image
  
      def load_video_frames(self):
          """ Return frames from a video file """
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Centralize cv2 image reading and handle bad filenames 
scripts/fsmedia.py