Add an apple-touch-icon because Apple is a special snowflake that cant use the favicon like everybody else

This commit is contained in:
Kovid Goyal 2017-05-28 13:25:51 +05:30
parent d0de1f377b
commit a0a1261bc4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 12 additions and 1 deletions

View File

@ -12,14 +12,19 @@ resources = j(os.path.dirname(base), 'resources')
icons = j(os.path.dirname(base), 'icons') icons = j(os.path.dirname(base), 'icons')
srv = j(os.path.dirname(os.path.dirname(base)), 'srv') srv = j(os.path.dirname(os.path.dirname(base)), 'srv')
def render(outpath, sz):
def render(outpath, sz, background=None):
sz = str(sz) sz = str(sz)
cmd = ['rsvg-convert', j(base, 'calibre.svg'), '-w', sz, '-h', sz, '-d', '96', '-p', '96', '-o', outpath] cmd = ['rsvg-convert', j(base, 'calibre.svg'), '-w', sz, '-h', sz, '-d', '96', '-p', '96', '-o', outpath]
if background:
cmd.insert(2, background), cmd.insert(2, '-b')
subprocess.check_call(cmd) subprocess.check_call(cmd)
subprocess.check_call(['optipng', '-o7', '-strip', 'all', outpath]) subprocess.check_call(['optipng', '-o7', '-strip', 'all', outpath])
render(j(resources, 'images', 'library.png'), 1024) render(j(resources, 'images', 'library.png'), 1024)
render(j(resources, 'images', 'lt.png'), 256) render(j(resources, 'images', 'lt.png'), 256)
render(j(resources, 'images', 'apple-touch-icon.png'), 256, 'white')
render(j(resources, 'content-server', 'calibre.png'), 128) render(j(resources, 'content-server', 'calibre.png'), 128)
render(j(srv, 'main', 'calibre-paypal-logo.png'), 60) render(j(srv, 'main', 'calibre-paypal-logo.png'), 60)
shutil.copy2(j(resources, 'content-server', 'calibre.png'), j(resources, 'content_server', 'calibre.png')) shutil.copy2(j(resources, 'content-server', 'calibre.png'), j(resources, 'content_server', 'calibre.png'))

View File

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" type="image/png" href="favicon.png"> <link rel="icon" type="image/png" href="favicon.png">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
</head> </head>
<body> <body>
<div id="page_load_progress"> <div id="page_load_progress">

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -220,6 +220,11 @@ def favicon(ctx, rd):
return share_open(I('lt.png'), 'rb') return share_open(I('lt.png'), 'rb')
@endpoint('/apple-touch-icon.png', auth_required=False, cache_control=24)
def apple_touch_icon(ctx, rd):
return share_open(I('apple-touch-icon.png'), 'rb')
@endpoint('/icon/{+which}', auth_required=False, cache_control=24) @endpoint('/icon/{+which}', auth_required=False, cache_control=24)
def icon(ctx, rd, which): def icon(ctx, rd, which):
sz = rd.query.get('sz') sz = rd.query.get('sz')