forked from 0x2620/pandora
fix data path
This commit is contained in:
parent
2b2941aec3
commit
b719c544ad
4 changed files with 7 additions and 7 deletions
|
@ -40,14 +40,14 @@ def render_icon(frame, timeline, icon):
|
||||||
timeline_width = 896
|
timeline_width = 896
|
||||||
timeline_height = 128
|
timeline_height = 128
|
||||||
timeline_image = Image.new('RGB', (timeline_width + 8, timeline_height + 8), (255, 255, 255))
|
timeline_image = Image.new('RGB', (timeline_width + 8, timeline_height + 8), (255, 255, 255))
|
||||||
mask_image = Image.open(os.path.join(static_root, 'png', 'iconTimelineOuterMask.png'))
|
mask_image = Image.open(os.path.join(static_root, 'iconTimelineOuterMask.png'))
|
||||||
icon_image.paste(timeline_image, (timeline_left - 4, timeline_top - 4), mask=mask_image)
|
icon_image.paste(timeline_image, (timeline_left - 4, timeline_top - 4), mask=mask_image)
|
||||||
timeline_image = Image.open(timeline) if timeline else Image.new('RGB', (timeline_width, timeline_height), (0, 0, 0))
|
timeline_image = Image.open(timeline) if timeline else Image.new('RGB', (timeline_width, timeline_height), (0, 0, 0))
|
||||||
timeline_image = timeline_image.resize((timeline_width, timeline_height), Image.ANTIALIAS)
|
timeline_image = timeline_image.resize((timeline_width, timeline_height), Image.ANTIALIAS)
|
||||||
mask_image = Image.open(os.path.join(static_root, 'png', 'iconTimelineInnerMask.png'))
|
mask_image = Image.open(os.path.join(static_root, 'iconTimelineInnerMask.png'))
|
||||||
icon_image.paste(timeline_image, (timeline_left, timeline_top), mask=mask_image)
|
icon_image.paste(timeline_image, (timeline_left, timeline_top), mask=mask_image)
|
||||||
# we're using jpegs with border-radius
|
# we're using jpegs with border-radius
|
||||||
# mask_image = Image.open(os.path.join(static_root, 'png', 'iconMask.png'))
|
# mask_image = Image.open(os.path.join(static_root, 'iconMask.png'))
|
||||||
# icon_image.putalpha(mask_image)
|
# icon_image.putalpha(mask_image)
|
||||||
icon_image.save(icon)
|
icon_image.save(icon)
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ def render_list_icon(frames, icon):
|
||||||
frame_image = frame_image.crop((0, top, frame_width_, top + frame_height))
|
frame_image = frame_image.crop((0, top, frame_width_, top + frame_height))
|
||||||
icon_image.paste(frame_image, (i % 2 * frame_width + (1 if i % 2 == 2 else 0),
|
icon_image.paste(frame_image, (i % 2 * frame_width + (1 if i % 2 == 2 else 0),
|
||||||
int(i / 2) * frame_height))
|
int(i / 2) * frame_height))
|
||||||
mask_image = Image.open(os.path.join(static_root, 'png', 'iconMask.png'))
|
mask_image = Image.open(os.path.join(static_root, 'iconMask.png'))
|
||||||
mask_image = mask_image.resize((icon_width, icon_height))
|
mask_image = mask_image.resize((icon_width, icon_height))
|
||||||
icon_image.putalpha(mask_image)
|
icon_image.putalpha(mask_image)
|
||||||
icon_image.save(icon)
|
icon_image.save(icon)
|
||||||
|
|
|
@ -43,7 +43,7 @@ def render_poster(title, director, year, series, oxdb_id, imdb_id, frame, timeli
|
||||||
poster_ratio = poster_width / poster_height
|
poster_ratio = poster_width / poster_height
|
||||||
poster_image = Image.new('RGB', (poster_width, poster_height))
|
poster_image = Image.new('RGB', (poster_width, poster_height))
|
||||||
draw = ImageDraw.Draw(poster_image)
|
draw = ImageDraw.Draw(poster_image)
|
||||||
font_file = os.path.join(static_root, 'ttf', 'DejaVuSansCondensedBold.ttf')
|
font_file = os.path.join(static_root, 'DejaVuSansCondensedBold.ttf')
|
||||||
|
|
||||||
font_size = {
|
font_size = {
|
||||||
'small': 28,
|
'small': 28,
|
||||||
|
@ -107,7 +107,7 @@ def render_poster(title, director, year, series, oxdb_id, imdb_id, frame, timeli
|
||||||
|
|
||||||
# logo
|
# logo
|
||||||
logo_height = 32
|
logo_height = 32
|
||||||
logo_image = Image.open(os.path.join(static_root, 'png', 'logo.png'))
|
logo_image = Image.open(os.path.join(static_root, 'logo.png'))
|
||||||
logo_width = int(round(logo_height * logo_image.size[0] / logo_image.size[1]))
|
logo_width = int(round(logo_height * logo_image.size[0] / logo_image.size[1]))
|
||||||
logo_image = logo_image.resize((logo_width, logo_height), Image.ANTIALIAS)
|
logo_image = logo_image.resize((logo_width, logo_height), Image.ANTIALIAS)
|
||||||
logo_left = text_width - text_margin - logo_width
|
logo_left = text_width - text_margin - logo_width
|
||||||
|
|
|
@ -24,7 +24,7 @@ def render_poster(id, title, frame, timeline, poster):
|
||||||
poster_ratio = poster_width / poster_height
|
poster_ratio = poster_width / poster_height
|
||||||
poster_color = (255, 255, 0)
|
poster_color = (255, 255, 0)
|
||||||
poster_image = Image.new('RGB', (poster_width, poster_height))
|
poster_image = Image.new('RGB', (poster_width, poster_height))
|
||||||
font_file = os.path.join(static_root, 'ttf', 'DejaVuSansCondensedBold.ttf')
|
font_file = os.path.join(static_root, 'DejaVuSansCondensedBold.ttf')
|
||||||
font_size = 48
|
font_size = 48
|
||||||
|
|
||||||
# timeline
|
# timeline
|
||||||
|
|
Loading…
Reference in a new issue