mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-10 01:10:11 +01:00
Keep the same ZipFile instance to retrieve all the icons
This commit is contained in:
parent
e81a3bae04
commit
d9d8448035
@ -458,6 +458,8 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
thisinfo['sig'] = output[7:].strip()
|
thisinfo['sig'] = output[7:].strip()
|
||||||
|
|
||||||
|
apk = zipfile.ZipFile(apkfile, 'r')
|
||||||
|
|
||||||
iconfilename = "%s.%s.png" % (
|
iconfilename = "%s.%s.png" % (
|
||||||
thisinfo['id'],
|
thisinfo['id'],
|
||||||
thisinfo['versioncode'])
|
thisinfo['versioncode'])
|
||||||
@ -469,7 +471,6 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||||||
if density not in thisinfo['icons_src']:
|
if density not in thisinfo['icons_src']:
|
||||||
empty_densities.append(density)
|
empty_densities.append(density)
|
||||||
continue
|
continue
|
||||||
apk = zipfile.ZipFile(apkfile, 'r')
|
|
||||||
if 'icons' not in thisinfo:
|
if 'icons' not in thisinfo:
|
||||||
thisinfo['icons'] = {}
|
thisinfo['icons'] = {}
|
||||||
iconsrc = thisinfo['icons_src'][density]
|
iconsrc = thisinfo['icons_src'][density]
|
||||||
@ -488,10 +489,10 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||||||
del thisinfo['icons_src'][density]
|
del thisinfo['icons_src'][density]
|
||||||
empty_densities.append(density)
|
empty_densities.append(density)
|
||||||
|
|
||||||
apk.close()
|
|
||||||
|
|
||||||
resize_icon(icondest, density)
|
resize_icon(icondest, density)
|
||||||
|
|
||||||
|
apk.close()
|
||||||
|
|
||||||
# First try resizing down to not lose quality
|
# First try resizing down to not lose quality
|
||||||
last_density = None
|
last_density = None
|
||||||
for density in densities:
|
for density in densities:
|
||||||
|
Loading…
Reference in New Issue
Block a user