enable tiny news logos
This commit is contained in:
parent
d04f217c24
commit
cd244cd9fb
@ -1553,19 +1553,19 @@ class StockTicker():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
logo_name = source.lower().replace(' ', '-')
|
logo_name = source.lower().replace(' ', '-')
|
||||||
logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'news_logos')
|
logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'tiny_news')
|
||||||
|
|
||||||
logo = Image.open(os.path.join(logos_path, logo_name + '.png'))
|
logo = Image.open(os.path.join(logos_path, logo_name + '.png'))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logo_name = 'default'
|
logo_name = 'default'
|
||||||
logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'news_logos')
|
logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'tiny_news')
|
||||||
|
|
||||||
logo = Image.open(os.path.join(logos_path, logo_name + '.png'))
|
logo = Image.open(os.path.join(logos_path, logo_name + '.png'))
|
||||||
|
|
||||||
width, height = logo.size
|
width, height = logo.size
|
||||||
|
|
||||||
logo = logo.resize((int(width/2), int(height/2)))
|
#logo = logo.resize((int(width/2), int(height/2)))
|
||||||
|
|
||||||
img = Image.new('RGB', (headline_img.size[0]+ source_img.size[0] + logo.size[0] +5, 32))
|
img = Image.new('RGB', (headline_img.size[0]+ source_img.size[0] + logo.size[0] +5, 32))
|
||||||
img.paste(headline_img, (source_img.size[0]+ logo.size[0] -5, 3))
|
img.paste(headline_img, (source_img.size[0]+ logo.size[0] -5, 3))
|
||||||
|
Loading…
Reference in New Issue
Block a user