mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add an apple-touch-icon because Apple is a special snowflake that cant use the favicon like everybody else
This commit is contained in:
parent
d0de1f377b
commit
a0a1261bc4
@ -12,14 +12,19 @@ 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):
|
||||
|
||||
def render(outpath, sz, background=None):
|
||||
sz = str(sz)
|
||||
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(['optipng', '-o7', '-strip', 'all', outpath])
|
||||
|
||||
|
||||
render(j(resources, 'images', 'library.png'), 1024)
|
||||
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(srv, 'main', 'calibre-paypal-logo.png'), 60)
|
||||
shutil.copy2(j(resources, 'content-server', 'calibre.png'), j(resources, 'content_server', 'calibre.png'))
|
||||
|
@ -7,6 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
</head>
|
||||
<body>
|
||||
<div id="page_load_progress">
|
||||
|
BIN
resources/images/apple-touch-icon.png
Normal file
BIN
resources/images/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
@ -220,6 +220,11 @@ def favicon(ctx, rd):
|
||||
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)
|
||||
def icon(ctx, rd, which):
|
||||
sz = rd.query.get('sz')
|
||||
|
Loading…
x
Reference in New Issue
Block a user