You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hu...@apache.org on 2018/08/29 00:51:15 UTC
svn commit: r1839522 - /comdev/project-logos/tools/poweredby.py
Author: humbedooh
Date: Wed Aug 29 00:51:14 2018
New Revision: 1839522
URL: http://svn.apache.org/viewvc?rev=1839522&view=rev
Log:
If a PB-specific image exists, use that.
Also check if the PB generated image exists or not, and gen if not.
Modified:
comdev/project-logos/tools/poweredby.py
Modified: comdev/project-logos/tools/poweredby.py
URL: http://svn.apache.org/viewvc/comdev/project-logos/tools/poweredby.py?rev=1839522&r1=1839521&r2=1839522&view=diff
==============================================================================
--- comdev/project-logos/tools/poweredby.py (original)
+++ comdev/project-logos/tools/poweredby.py Wed Aug 29 00:51:14 2018
@@ -18,19 +18,22 @@ projects = [x for x in os.listdir(res_di
for project in sorted(projects):
dpath = '%s/%s/default_hr.png' % (res_dir, project)
+ if os.path.exists('%s/%s/%s-pb_highres.png' % (res_dir, project, project)):
+ dpath = '%s/%s/%s-pb_highres.png' % (res_dir, project, project)
+ outpath = '%s/%s.png' % (pb_dir, project)
if os.path.exists(dpath):
try:
st = os.stat(dpath)
except:
st = None
- if (not st) or st.st_mtime > (time.time() - 43200):
+ if st and (st.st_mtime > (time.time() - 43200) or not os.path.exists(outpath)):
back = Image.open(pb_image)
front = Image.open('%s/%s/default_hr.png' % (res_dir, project))
w = front.width
h = front.height
to_edge = math.sqrt(((w/2)*(w/2)) + ((h/2)*(h/2)))
- while to_edge > 472:
+ while to_edge > 520:
w *= 0.995
h *= 0.995
to_edge = math.sqrt(((w/2)*(w/2)) + ((h/2)*(h/2)))