1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

Start publishing new repo icons at max 72x72 px

This commit is contained in:
Daniel Martí 2013-08-19 11:20:50 +02:00
parent b55060f4c7
commit a1c2dc1a75
2 changed files with 12 additions and 0 deletions

View File

@ -134,6 +134,8 @@ Ruby (debian packages ruby and rubygems)
Vagrant (gem install vagrant)
@item
Paramiko (debian package python-paramiko)
@item
Imaging (debian package python-imaging)
@end itemize

View File

@ -31,6 +31,7 @@ from optparse import OptionParser
import time
import common
from common import MetaDataException
from PIL import Image
def update_wiki(apps, apks, verbose=False):
"""Update the wiki
@ -357,6 +358,15 @@ def scan_apks(apps, apkcache, repodir, knownapks):
print "WARNING: Error retrieving icon file"
apk.close()
im = Image.open(iconfilename)
if any(length > 72 for length in im.size):
print iconfilename, "is too large:", im.size
im.thumbnail((72, 72), Image.ANTIALIAS)
print iconfilename, "new size:", im.size
im.save(iconfilename, "PNG")
else:
print iconfilename, "is small enough:", im.size
# Record in known apks, getting the added date at the same time..
added = knownapks.recordapk(thisinfo['apkname'], thisinfo['id'])
if added: