make systems without imdb work

This commit is contained in:
j 2011-01-28 14:18:38 +05:30
commit 200741445f
10 changed files with 76 additions and 36 deletions

View file

@ -51,7 +51,7 @@ def render_poster(id, title, frame, timeline, poster):
else:
pixel = list(poster_image.getpixel((x, y)))
for c in range(3):
pixel[c] = (pixel[c] + poster_color[c]) / 4
pixel[c] = int((pixel[c] + poster_color[c]) / 4)
poster_image.putpixel((x, y), tuple(pixel))
drawText(poster_image, ((poster_width - text_size[0]) / 2, text_top + (text_height - text_size[1]) / 2), text, font_file, font_size, poster_color)
poster_image.save(poster)
@ -60,6 +60,8 @@ def main():
parser = OptionParser()
parser.add_option('-i', '--id', dest='id', help='Pad.ma Id')
parser.add_option('-t', '--title', dest='title', help='Title', default='')
parser.add_option('-d', '--director', dest='director', help='Director', default='')
parser.add_option('-y', '--year', dest='year', help='Year', default='')
parser.add_option('-f', '--frame', dest='frame', help='Poster frame (image file to be read)')
parser.add_option('-l', '--timeline', dest='timeline', help='Timeline (image file to be read)')
parser.add_option('-p', '--poster', dest='poster', help='Poster (image file to be written)')