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:
parent
d6810bfaf7
commit
f82207ec60
@ -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…
Reference in New Issue
Block a user