'Try to guess a cover. Needed for some old/badly formed OPF files.'

def guess_cover(self):

    if (self.base_dir and os.path.exists(self.base_dir)):
        for item in self.identifier_path(self.metadata):
            scheme = None
            for key in item.attrib.keys():
                if key.endswith('scheme'):
                    scheme = item.get(key)
                    break
            if (scheme is None):
                continue
            if item.text:
                prefix = item.text.replace('-', '')
                for suffix in ['.jpg', '.jpeg', '.gif', '.png', '.bmp']:
                    cpath = os.access(os.path.join(self.base_dir, (prefix + suffix)), os.R_OK)
                    if os.access(os.path.join(self.base_dir, (prefix + suffix)), os.R_OK):
                        return cpath
