View Single Post
Old 03-08-2011, 11:32 AM   #3
chewi
Member
chewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-books
 
chewi's Avatar
 
Posts: 14
Karma: 822
Join Date: Nov 2010
Device: sony prs-650
Question

As I understand, this code is sample

Spoiler:
def default_cover(self, cover_file):
'''
Create a generic cover for recipes that dont have a cover
'''
try:
from calibre.ebooks import calibre_cover
title = self.title if isinstance(self.title, unicode) else \
self.title.decode(preferred_encoding, 'replace')
date = strftime(self.timefmt)
img_data = calibre_cover(title, date)
cover_file.write(img_data)
cover_file.flush()
except:
self.log.exception('Failed to generate default cover')
return False
return True


I want:
- use cover image from url 'http://pics.rbc.ru/img/top/2002/04/26/rbc-logo.gif'
- add borders like command cover_margins = (200, 300, '#ffffff') do
- add title and date to the resulting cover

Can you help with the code for all this steps?
chewi is offline   Reply With Quote