diff --git a/icons/icns/make_iconsets.py b/icons/icns/make_iconsets.py index a3a40b49eb..9cfba651ef 100644 --- a/icons/icns/make_iconsets.py +++ b/icons/icns/make_iconsets.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal ' -import os, shutil, subprocess +import os, shutil, subprocess, sys d, j, a = (getattr(os.path, x) for x in ('dirname', 'join', 'abspath')) base = d(a(__file__)) @@ -14,6 +14,8 @@ os.chdir(base) imgsrc = j(d(d(base)), 'imgsrc') sources = {'calibre':j(imgsrc, 'calibre.svg'), 'ebook-edit':j(imgsrc, 'tweak.svg'), 'ebook-viewer':j(imgsrc, 'viewer.svg'), 'book':j(imgsrc, 'book.svg')} +if sys.argv[-1] == 'only-logo': + sources = {'calibre':sources['calibre']} for name, src in sources.iteritems(): iconset = name + '.iconset' diff --git a/icons/library.ico b/icons/library.ico index 3da9c13a75..49c54134f2 100644 Binary files a/icons/library.ico and b/icons/library.ico differ diff --git a/icons/make_ico_files.py b/icons/make_ico_files.py index c7e7423a70..053c204fec 100644 --- a/icons/make_ico_files.py +++ b/icons/make_ico_files.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal ' -import os, shutil, subprocess +import os, shutil, subprocess, sys d, j, a = (getattr(os.path, x) for x in ('dirname', 'join', 'abspath')) base = d(a(__file__)) @@ -14,6 +14,8 @@ os.chdir(base) imgsrc = j(d(base), 'imgsrc') sources = {'library':j(imgsrc, 'calibre.svg'), 'ebook-edit':j(imgsrc, 'tweak.svg'), 'viewer':j(imgsrc, 'viewer.svg'), 'favicon':j(imgsrc, 'calibre.svg')} +if sys.argv[-1] == 'only-logo': + sources = {'library':sources['library']} for name, src in sources.iteritems(): os.mkdir('ico_temp') diff --git a/imgsrc/calibre.svg b/imgsrc/calibre.svg index f3765aa840..980e7506ef 100644 --- a/imgsrc/calibre.svg +++ b/imgsrc/calibre.svg @@ -20,147 +20,21 @@ width="1024"> - - - - - - - + inkscape:collect="always" + id="endcap-3"> + id="stop4283" /> + id="stop4299" + offset="0.86720961" + style="stop-color:#45181d;stop-opacity:1" /> - - - - - - - - + id="stop4301" /> - - - + xlink:href="#endcap-3" + id="radialGradient4309" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(11.938212,-1.443998,0.08995089,0.74366689,-6850.4532,1021.976)" + cx="620.70544" + cy="1109.0797" + fx="620.70544" + fy="1109.0797" + r="41.080517" /> + + + + + + + image/svg+xml - + @@ -909,15 +789,6 @@ x="-874.68134" y="399.19296" style="fill:url(#radialGradient6763);fill-opacity:1;">Kovid Goyal - - - - + + + + + + + + + + + diff --git a/imgsrc/render-logo.py b/imgsrc/render-logo.py new file mode 100755 index 0000000000..7510e95038 --- /dev/null +++ b/imgsrc/render-logo.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python2 +# vim:fileencoding=utf-8 +# License: GPLv3 Copyright: 2016, Kovid Goyal + +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']) diff --git a/resources/content-server/calibre.png b/resources/content-server/calibre.png index 77af328ba5..8067745eb8 100644 Binary files a/resources/content-server/calibre.png and b/resources/content-server/calibre.png differ diff --git a/resources/content_server/calibre.png b/resources/content_server/calibre.png index 77af328ba5..8067745eb8 100644 Binary files a/resources/content_server/calibre.png and b/resources/content_server/calibre.png differ diff --git a/resources/images/library.png b/resources/images/library.png index cb8a08134f..934de7d0ef 100644 Binary files a/resources/images/library.png and b/resources/images/library.png differ diff --git a/resources/images/lt.png b/resources/images/lt.png index 14102757b8..0a484de25b 100644 Binary files a/resources/images/lt.png and b/resources/images/lt.png differ