code: def do_first(self):
          
          self.logger.debug("do_first: src=%s" % (self.srcfile))
          try:
              self.image = Image.open(self.srcfile)
          except Image.DecompressionBombWarning as e:
              # This exception will be raised only if PIL has been
              # configured to raise an error in the case of images
              # that exceeed Image.MAX_IMAGE_PIXELS, with
              # Image.warnings.simplefilter('error', Image.DecompressionBombWarning)
              raise IIIFError(text=("Image size limit exceeded (PIL: %s)" % (str(e))))
          except Exception as e:
              raise IIIFError(text=("Failed to read image (PIL: %s)" % (str(e))))
          (self.width, self.height) = self.image.size
docs: Create PIL object from input image file.
  
          Image location must be in self.srcfile. Will result in
          self.width and self.height being set to the image dimensions.
  
          Will raise an IIIFError on failure to load the image