xAssets - Update Icon
This commit is contained in:
parent
14d558d6e8
commit
795c36313a
|
@ -10,7 +10,7 @@ json5==0.9.6
|
|||
jsonpatch==1.22
|
||||
jsonpointer==2.0
|
||||
jsonschema==3.2.0
|
||||
numpy==1.21.2
|
||||
numpy
|
||||
pandas==1.3.3
|
||||
Pillow==8.3.2
|
||||
python-dateutil==2.8.2
|
||||
|
|
|
@ -48,7 +48,7 @@ def get_wormhole_logo(style=None):
|
|||
filename = 'wormhole' if style is None else 'wormhole_%s' % style
|
||||
path = os.path.join(SRC_PATH, 'logogen', 'components', filename + '.png')
|
||||
img = Image.open(path).resize(MINI_DIM).convert('RGBA')
|
||||
img = add_margin(img, L-S-OFFSET, OFFSET, OFFSET, L-S-OFFSET)
|
||||
img = add_margin(img, OFFSET, OFFSET, L-S-OFFSET, L-S-OFFSET)
|
||||
return img
|
||||
|
||||
|
||||
|
@ -74,9 +74,12 @@ def get_base_logo(name):
|
|||
|
||||
# case 1: svg
|
||||
if logo_url.endswith('svg'):
|
||||
tmp = tempfile.NamedTemporaryFile()
|
||||
cairosvg.svg2png(url=logo_url, write_to=tmp.name)
|
||||
img = Image.open(tmp.name)
|
||||
with tempfile.NamedTemporaryFile(delete=False) as tmp:
|
||||
tmp.close()
|
||||
cairosvg.svg2png(url=logo_url, write_to=tmp.name)
|
||||
with Image.open(tmp.name) as img:
|
||||
img = img.copy()
|
||||
os.unlink(tmp.name)
|
||||
# case 2: not
|
||||
else:
|
||||
response = requests.get(logo_url, headers={'User-Agent': 'Mozilla/5.0'})
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 190 KiB |
Binary file not shown.
After Width: | Height: | Size: 165 KiB |
Loading…
Reference in New Issue