'Create a generic cover for books that dont have a cover'

def default_cover(self):

    if self.no_default_cover:
        return None
    self.log('Generating    default    cover')
    m = self.oeb.metadata
    title = unicode(m.title[0])
    authors = [unicode(x) for x in m.creator if (x.role == 'aut')]
    try:
        from calibre.ebooks.covers import create_cover
        series = series_index = None
        if m.series:
            try:
                (series, series_index) = (unicode(m.series[0]), m.series_index[0])
            except IndexError:
                pass
        img_data = create_cover(title, authors, series, series_index)
        (id, href) = self.oeb.manifest.generate('cover', u'cover_image.jpg')
        item = self.oeb.manifest.add(id, href, guess_type('t.jpg')[0], data=img_data)
        m.clear('cover')
        m.add('cover', item.id)
        return item.href
    except:
        self.log.exception('Failed    to    generate    default    cover')
    return None
