-
[x] I’m using stock docker compose setup, unmodified.
-
[ ] I’m using docker compose setup, with modifications (modified .yml files, third party plugins/themes, etc.) - if so, describe your modifications in your post. Before reporting, see if your issue can be reproduced on the unmodified setup.
-
[ ] I’m not using docker on my primary instance, but my issue can be reproduced on the aforementioned docker setup and/or official demo.
TT-RSS doesn’t recognize SVG favicons, which are becoming more prevalent (e.g., github.com)
Feed debugger output:
[12:22:18/29272] processing feed data...
[12:22:18/29272] site_url: https://github.com/Radarr/Radarr/commits/develop
[12:22:18/29272] feed_title: Recent Commits to Radarr:develop
[12:22:18/29272] favicon: needs check: 1 is custom: avg color:
[12:22:18/29272] favicon: trying to update favicon...
[12:22:18/29272] favicon https://github.githubassets.com/favicons/favicon.svg type is unknown (not updating)
[12:22:18/29272] favicon: trying to calculate average color...
[12:22:18/29272] favicon: avg color:
- Tiny Tiny RSS version (including git commit id): v22.05-09fb227
- Platform (i.e. Linux distro, Docker, PHP, PostgreSQL, etc) versions: Docker version 20.10.5
Github, at least, defines an alternate (PNG) icon that TT-RSS could look for if the main icon fails to load:
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000">
<link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png">
<link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
Then of course there are the sites with broken favicons… 
[12:46:10/30704] processing feed data...
[12:46:10/30704] **site_url: https://git.tt-rss.org/fox/tt-rss.wiki.git/**
[12:46:10/30704] feed_title: tt-rss.wiki.git, branch master
[12:46:10/30704] favicon: needs check: 1 is custom: avg color:
[12:46:10/30704] favicon: trying to update favicon...
[12:46:11/30704] favicon: fetching **https://git.tt-rss.org/favicon.ico failed**
fox
2
i wasn’t aware we had some kind of favicon mime-type whitelist, i’ll take a look when i have some time to kill, unless someone files a PR.
not sure if allowing svg+xml is a good idea though, we only show those in img elements but still.
fox
3
btw,
thanks for noticing, this should be fixed now.
you people and your favicon obsession.
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000">
i can’t really be bothered to dig into the the spec so i’m just guessing here. this isn’t just an SVG image, it might be painted over using some kind of custom color which should also be stored per-feed and passed to tt-rss UI. do img tags support this? who knows. i can tell you one thing - supporting this, in particular, is definitely too much effort.
would you be fine with an SVG favicon possibly displayed improperly because we didn’t take this color into account?
e: when determining feed-specific favicon, instead of using first match or generic fallback, go through entire list of determined favicon URLs · b0059d3f88 - tt-rss - Tiny Tiny RSS
this should handle ‘alternate icon’.
Icon for git.tt-rss.org looking good. Github alternate icon not so much, as it’s basically black on black - not something I expect tt-rss to solve.
One more issue: When I specify a custom site_url, tt-rss never checks for a favicon at that url. It only looks at the site_url it finds in the feed (e.g., /rss/channel/link).
For example: Feed http://rssfeeds.freep.com/freep/home&x=1 contains
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
<channel>
<title>GANNETT Syndication Service</title>
<link>https://api-internal.usatoday.com.akadns.net</link>
That link doesn’t work, so I set site_url to https://www.freep.com/
Then debug feed says:
[03:30:19/683] start
[03:30:19/683] running HOOK_FETCH_FEED handlers...
[03:30:19/683] === 0.0003 (sec) Af_Comics
[03:30:19/683] feed data has not been modified by a plugin.
[03:30:19/683] local cache will not be used for this feed
[03:30:19/683] last unconditional update request: 2022-05-29 03:23:22
[03:30:19/683] stored last modified for conditional request: Sun, 29 May 2022 02:49:03 GMT
[03:30:19/683] fetching http://rssfeeds.freep.com/freep/home&x=1 (force_refetch: )...
[03:30:19/683] [UrlHelper] fetching: http://rssfeeds.freep.com/freep/home&x=1
[03:30:19/683] fetch done.
[03:30:19/683] effective URL (after redirects): http://rssfeeds.freep.com/freep/home&x=1 (IP: 198.71.55.253)
[03:30:19/683] server last modified: Sun, 29 May 2022 02:49:03 GMT
[03:30:19/683] saving to local cache: cache/feeds/a5160ea603ee547eb08327684bf58dad4c9d07c2.xml
[03:30:19/683] running HOOK_FEED_FETCHED handlers...
[03:30:19/683] feed data has not been modified by a plugin.
[03:30:19/683] running HOOK_FEED_PARSED handlers...
[03:30:19/683] language: simple
[03:30:19/683] processing feed data...
[03:30:19/683] site_url: https://api-internal.usatoday.com.akadns.net
[03:30:19/683] feed_title: GANNETT Syndication Service
[03:30:19/683] favicon: needs check: 1 is custom: avg color: #0098ff
[03:30:19/683] favicon: trying to update favicon...
[03:30:19/683] [UrlHelper] fetching: https://api-internal.usatoday.com.akadns.net
[03:30:19/683] [UrlHelper] fetching: https://api-internal.usatoday.com.akadns.net/favicon.ico
[03:30:19/683] favicon: fetching https://api-internal.usatoday.com.akadns.net/favicon.ico failed, skipping...
If user defines a different site_url, I think tt-rss should be checking that for favicon instead of (or at least in addition to) whatever is derived from feed xml.
fox
5
Hey, just figured out how to quote.
Consequence of dark mode, I guess (in this case, either tt-rss night theme or Firefox theme). Site has to offer dark mode optimized icon, either SVG modified on the fly or second set of static images, in response to (prefers-color-scheme: dark). That would have to be another thing factored into favicon fetching, and probably not worth it unless implementing SVG icon support.

fox
7
ah, white part of the icon is actually transparent? yeah that would do it.
i guess we could blend those on white or some kind of neutral gray in dark mode because everything still defaults to light mode so it would be reasonable to expect favicons to be legible in such environment. idk if its worth the trouble.
evil option would be inverting favicons.
I’ve no idea the amount of work or bad juju involved in either option, so I’ll leave that up to you. Thanks for all you’ve done thus far.