From: Daniel Martí Date: Mon, 19 Aug 2013 09:20:50 +0000 (+0200) Subject: Start publishing new repo icons at max 72x72 px X-Git-Tag: 0.1~442 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a1c2dc1a756c95416259c68b9d78de9d2ab8676b;p=fdroidserver.git Start publishing new repo icons at max 72x72 px --- diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 094dad62..9cdced29 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -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 diff --git a/fdroidserver/update.py b/fdroidserver/update.py index d40773d5..bd630657 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -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: