<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def source_filename(self, docname: str, srcdir: str):
 """ Get the full filename to referenced image """


        docpath = Path(srcdir, docname)
        parent = docpath.parent
        imgpath = parent.joinpath(self.filename)

        # Does this exist?
        if not imgpath.exists():
            msg = f'Image does not exist at "{imgpath}"'
            raise SphinxError(msg)

        return imgpath