22 lines
719 B
Python
22 lines
719 B
Python
"""Export the approved PNG master into application and documentation icons."""
|
|
from pathlib import Path
|
|
|
|
from PIL import Image
|
|
|
|
|
|
def main():
|
|
root = Path(__file__).resolve().parents[1]
|
|
assets = root / 'src/dx_productivity/trial_task_center/assets'
|
|
with Image.open(assets / 'app-master.png') as source:
|
|
image = source.convert('RGBA')
|
|
if image.size != (1024, 1024):
|
|
raise ValueError('Application icon master must be 1024x1024')
|
|
image.save(assets / 'app.png')
|
|
image.save(assets / 'app.ico', sizes=[(n, n) for n in (16, 20, 24, 32, 40, 48, 64, 96, 128, 256)])
|
|
image.save(root / 'docs/user/media/app-icon.png')
|
|
print(assets / 'app.ico')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|