1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

Keep the same ZipFile instance to retrieve all the icons

This commit is contained in:
Daniel Martí 2014-01-07 16:17:38 +01:00
parent e81a3bae04
commit d9d8448035

View File

@ -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: