Skip to content

Commit

Permalink
fix clean out dir before move, fix icon app
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed Jul 27, 2022
1 parent 2306d42 commit 6762531
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion buildozer/targets/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from buildozer.target import Target, no_config
from os.path import join, basename, expanduser, realpath
from getpass import getpass
from PIL import Image


PHP_TEMPLATE = '''
Expand Down Expand Up @@ -310,6 +311,8 @@ def build_package(self):
cwd=build_dir)

self.buildozer.info('Moving IPA to bin...')
# clean out dir
self.buildozer.rmdir(ipa)
self.buildozer.file_rename(ipa_tmp, ipa)

self.buildozer.info('iOS packaging done!')
Expand Down Expand Up @@ -363,7 +366,14 @@ def _create_icons(self):
icon = self.buildozer.config.getdefault('app', 'icon.filename', '')
if not icon:
return
icon_fn = join(self.buildozer.app_dir, icon)
# get icon size and make it for god for not get err
img = Image.open(icon)
if img.height != 72 or img.width != 72:
self.buildozer.debug('Icon size as bad format try to make a new format: {}/{} to 72/72.'.format(img.height, img.width))
size = 72, 72
img = img.resize(size, Image.ANTIALIAS)
img.save(join(self.app_project_dir, 'icon.png'), "PNG")
icon_fn = join(self.app_project_dir, 'icon.png')
if not self.buildozer.file_exists(icon_fn):
self.buildozer.error('Icon {} does not exists'.format(icon_fn))
return
Expand Down

0 comments on commit 6762531

Please sign in to comment.