mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-09 02:41:06 +03:00
Keep the same ZipFile instance to retrieve all the icons
This commit is contained in:
parent
d6810bfaf7
commit
f82207ec60
1 changed files with 4 additions and 3 deletions
|
@ -458,6 +458,8 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||
sys.exit(1)
|
||||
thisinfo['sig'] = output[7:].strip()
|
||||
|
||||
apk = zipfile.ZipFile(apkfile, 'r')
|
||||
|
||||
iconfilename = "%s.%s.png" % (
|
||||
thisinfo['id'],
|
||||
thisinfo['versioncode'])
|
||||
|
@ -469,7 +471,6 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||
if density not in thisinfo['icons_src']:
|
||||
empty_densities.append(density)
|
||||
continue
|
||||
apk = zipfile.ZipFile(apkfile, 'r')
|
||||
if 'icons' not in thisinfo:
|
||||
thisinfo['icons'] = {}
|
||||
iconsrc = thisinfo['icons_src'][density]
|
||||
|
@ -488,10 +489,10 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||
del thisinfo['icons_src'][density]
|
||||
empty_densities.append(density)
|
||||
|
||||
apk.close()
|
||||
|
||||
resize_icon(icondest, density)
|
||||
|
||||
apk.close()
|
||||
|
||||
# First try resizing down to not lose quality
|
||||
last_density = None
|
||||
for density in densities:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue