docs: def image_request_response(self, path):
          """Parse image request and create response."""
          # Parse the request in path
          if (len(path) > 1024):
              raise IIIFError(code=414,
                              text="URI Too Long: Max 1024 chars, got %d\n" % len(path))
          try:
              self.iiif.identifier = self.identifier
              self.iiif.parse_url(path)
          except IIIFRequestPathError as e:
              # Reraise as IIIFError with code=404 because we can't tell
              # whether there was an encoded slash in the identifier or
              # whether there was a bad number of path segments.
              raise IIIFError(code=404, text=e.text)
          except IIIFError as e:
              # Pass through
              raise e
          except Exception as e:
              # Something completely unexpected => 500
              raise IIIFError(code=500,
                              text="Internal Server Error: unexpected exception parsing request (" + str(e) + ")")
          dr = degraded_request(self.identifier)
          if (dr):
              self.logger.info("image_request: degraded %s -> %s" %
                               (self.identifier, dr))
              self.degraded = self.identifier
              self.identifier = dr
              self.iiif.quality = 'gray'
          else:
              # Parsed request OK, attempt to fulfill
              self.logger.info("image_request: %s" % (self.identifier))
          file = self.file
          self.manipulator.srcfile = file
          self.manipulator.do_first()
          if (self.api_version < '2.0' and
                  self.iiif.format is None and
                  'Accept' in request.headers):
              # In 1.0 and 1.1 conneg was specified as an alternative to format, see:
              # http://iiif.io/api/image/1.0/#format
              # http://iiif.io/api/image/1.1/#parameters-format
              formats = {'image/jpeg': 'jpg', 'image/tiff': 'tif',
                         'image/png': 'png', 'image/gif': 'gif',
                         'image/jp2': 'jps', 'application/pdf': 'pdf'}
              accept = do_conneg(request.headers['Accept'], list(formats.keys()))
              # Ignore Accept header if not recognized, should this be an error
              # instead?
              if (accept in formats):
                  self.iiif.format = formats[accept]
          (outfile, mime_type) = self.manipulator.derive(file, self.iiif)
          # FIXME - find efficient way to serve file with headers
          self.add_compliance_header()
          return send_file(outfile, mimetype=mime_type)