calibre/imgsrc/render-logo.py
Kovid Goyal 6f894753f3 Some more refinements to the logo
Make the ends caps ont heyellow book more like the ones in the original
logo. Adda  dfrop shadow to the bookmark.
2016-09-23 12:02:33 +05:30

37 lines
1.7 KiB
Python
Executable file

#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import os, subprocess, sys, shutil
j = os.path.join
base = os.path.dirname(os.path.abspath(__file__))
resources = j(os.path.dirname(base), 'resources')
icons = j(os.path.dirname(base), 'icons')
srv = j(os.path.dirname(os.path.dirname(base)), 'srv')
def render(outpath, sz):
sz = str(sz)
cmd = ['rsvg-convert', j(base, 'calibre.svg'), '-w', sz, '-h', sz, '-d', '96', '-p', '96', '-o', outpath]
subprocess.check_call(cmd)
subprocess.check_call(['optipng', '-o7', '-strip', 'all', outpath])
render(j(resources, 'images', 'library.png'), 1024)
render(j(resources, 'images', 'lt.png'), 256)
render(j(resources, 'content-server', 'calibre.png'), 128)
shutil.copy2(j(resources, 'content-server', 'calibre.png'), j(resources, 'content_server', 'calibre.png'))
shutil.copy2(j(resources, 'images', 'lt.png'), j(srv, 'common', 'favicon.png'))
shutil.copy2(j(resources, 'images', 'lt.png'), j(srv, 'common', 'favicon.png'))
subprocess.check_call([sys.executable, j(icons, 'make_ico_files.py'), 'only-logo'])
shutil.copy2(j(icons, 'library.ico'), j(srv, 'common', 'favicon.ico'))
shutil.copy2(j(icons, 'library.ico'), j(srv, 'main/static/resources/img', 'favicon.ico'))
shutil.copy2(j(icons, 'library.ico'), j(srv, 'open-books/drmfree/static/img', 'favicon.ico'))
subprocess.check_call([sys.executable, j(icons, 'icns', 'make_iconsets.py'), 'only-logo'])
os.chdir(srv)
subprocess.check_call(['git', 'commit', '-am', 'Update calibre favicons'])
for s in 'main code open-books dl1'.split():
subprocess.check_call(['./publish', s, 'update'])