add check logo exist
This commit is contained in:
parent
21500a34e3
commit
3ecc980fb1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
venv/
|
venv/
|
||||||
dist/
|
dist/
|
||||||
assm/__pycache__
|
assm/__pycache__
|
||||||
|
images/
|
||||||
|
logo.png
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"""iOS splash screen generator"""
|
"""iOS splash screen generator"""
|
||||||
|
|
||||||
__version__ = "0.1.1"
|
__version__ = "0.1.2"
|
||||||
|
@ -19,7 +19,14 @@ def make_splash_image(screen_orientation, screen_width, screen_height, logo_path
|
|||||||
splash_image = Image.new('RGB', (screen_width, screen_height), (255, 255, 255))
|
splash_image = Image.new('RGB', (screen_width, screen_height), (255, 255, 255))
|
||||||
logo_image = Image.open(logo_path)
|
logo_image = Image.open(logo_path)
|
||||||
app_logo = logo_image.resize((logo_size, logo_size))
|
app_logo = logo_image.resize((logo_size, logo_size))
|
||||||
|
|
||||||
|
try:
|
||||||
splash_image.paste(app_logo, (logo_w_pos, logo_h_pos), app_logo)
|
splash_image.paste(app_logo, (logo_w_pos, logo_h_pos), app_logo)
|
||||||
|
except ValueError as e:
|
||||||
|
if str(e) == 'bad transparency mask':
|
||||||
|
print('ERROR: Bad transparency mask.')
|
||||||
|
|
||||||
|
quit(-1)
|
||||||
|
|
||||||
return splash_image
|
return splash_image
|
||||||
|
|
||||||
@ -42,10 +49,14 @@ def main(output_folder='./images/'):
|
|||||||
f=output_folder, w=device_w, h=device_h
|
f=output_folder, w=device_w, h=device_h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
splash = make_splash_image('portrait', device_w, device_h, 'logo.png')
|
splash = make_splash_image('portrait', device_w, device_h, 'logo.png')
|
||||||
|
except FileNotFoundError as e:
|
||||||
|
print('ERROR: File logo.png not found.')
|
||||||
|
quit(1)
|
||||||
splash.save(file_name)
|
splash.save(file_name)
|
||||||
|
|
||||||
print('..splash for {w}x{h} saved...'.format(w=device_w, h=device_h))
|
print('...splash for {w}x{h} saved...'.format(w=device_w, h=device_h))
|
||||||
|
|
||||||
# landscape
|
# landscape
|
||||||
print('Generate landscape splash...')
|
print('Generate landscape splash...')
|
||||||
|
@ -7,24 +7,20 @@ module = "assm"
|
|||||||
author = "Alexander Popov"
|
author = "Alexander Popov"
|
||||||
author-email = "iiiypuk@iiiypuk.me"
|
author-email = "iiiypuk@iiiypuk.me"
|
||||||
home-page = "https://github.com/emilecok/assm"
|
home-page = "https://github.com/emilecok/assm"
|
||||||
requires = ["Pillow==8.1.0" ]
|
requires = ["Pillow==8.3.1" ]
|
||||||
description-file = "README.md"
|
description-file = "README.md"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
"Programming Language :: Python :: 3"
|
"Programming Language :: Python :: 3"
|
||||||
]
|
]
|
||||||
requires-python = ">=3"
|
requires-python = ">=3"
|
||||||
keywords = [
|
keywords = "iOS,splashscreen,splash-screen"
|
||||||
"iOS",
|
|
||||||
"splashscreen",
|
|
||||||
"splash-screen"
|
|
||||||
]
|
|
||||||
|
|
||||||
[tool.flit.metadata.requires-extra]
|
[tool.flit.metadata.requires-extra]
|
||||||
dev = ["pylint == 2.7.1", "black == 20.8b1"]
|
dev = ["pylint == 2.7.1", "black == 20.8b1"]
|
||||||
|
|
||||||
[tool.flit.metadata.urls]
|
[tool.flit.metadata.urls]
|
||||||
Documentation = ""
|
Documentation = "https://docs/"
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 99
|
line-length = 99
|
||||||
|
Loading…
Reference in New Issue
Block a user