navossoc/KeePass-Yet-Another-Favicon-Downloader

[Feature Request] Option to download icons only of a specific size (16x16px, 32x32px, etc.)

Opened this issue ยท 13 comments

Current Situation
When downloading favicons with the YAFD-Plugin, some downloaded icons have a size of 16x16 pixels, some have 48x48 pixels, some even have 256x256 pixels. However, KeePass displays icons only at the size of 16x16 pixels (or 32x32px if users have a 4k display). This makes the database file increase dramatically in size without any benefit. Most websites offer a great variety of favicon sizes to download in their HTML source code, so there's no need for YAFD to always download the largest one.

Requested feature
Give users the option (via a customizable setting/dropdown-list somewhere in the YAFD configuration section) to download only favicons of a specific size. Users should be able to choose between the following sizes: 16x16, 24x24, 32x32, 48x48, 64x64, 96x96, 128x128, 192x192, 256x256, 512x512, 1024x1024.

Benefits
Users would be able to download only the specific icon sizes that fit best for their display resolution (2k standard resolution, 4k, 5k, 8k etc.). Also, the database file would stay at a reasonable small file size, because unnecessary large icons (like 256x256) would not be downloaded if the user chose to download only 32x32px favicons.

Thanks!

This is a good idea, but some sites doesn't specify the size of the icons or they provide wrong information.
For this kind of idea works, it will be necessary to download all icons on the page.

Right now there is no clear rule about the smallest, largest size. We are download it on the order they appear on the page source.

Hrxn commented

Another issue here: Many sites, even today, only provide a 16x16 favicon.

What help would be some 3rd-party web service or online database for favicons. Just as a fallback.
I think such a site used to exist, but I don't know if it is still online.

@navossoc I can totally understand that this is a huge problem. What about implementing a function in the YAFD plugin that resizes larger icons down to the size set by the user?
An older favicon download plugin (https://sourceforge.net/projects/keepass-favicon) downloads only the 16x16px icons. Is this by design or just a limitation/inability of this older plugin to download other sizes?

To be honest, today I would not develop this plugin the way it was done. (maybe a v2?)

I believe that the best solution is to use some kind of web service to search for and obtain the favicons.
The .NET framework (both on Windows and Linux) has its own bugs.
The SSL / TLS support and certificate authorities depends on the operational system and on the framework version.

Now with this idea of manipulating the icons/images to obtain their dimensions or even resizing them, I believe that this may impose a security risk.

If there is a web service that does all of this work, KeePass would have less contact with third party sites and it would be easier to update / maintain the plugin.

PS: I'm trying to take a look this week on the issues/pull requests.

Hrxn commented

@navossoc Please don't worry too much, I think your plugin works just fine and does its job really well. ๐Ÿ˜…

To be honest, today I would not develop this plugin the way it was done. (maybe a v2?)

I believe that the best solution is to use some kind of web service to search for and obtain the favicons.
The .NET framework (both on Windows and Linux) has its own bugs.
The SSL / TLS support and certificate authorities depends on the operational system and on the framework version.

Now with this idea of manipulating the icons/images to obtain their dimensions or even resizing them, I believe that this may impose a security risk.

If there is a web service that does all of this work, KeePass would have less contact with third party sites and it would be easier to update / maintain the plugin.

PS: I'm trying to take a look this week on the issues/pull requests.

I used to use a site that was web-based that would grab the favicon prior to anyone developing a favicon addon.

I cannot seem to find it anymore, I'll continue to look through my archived bookmarks. All I find now are tons and tons of sites for generating favicons.

However, in my search, I did find a couple of gems.

  1. This is a website that offers an API to grab favicons, that seems to have a bit more behind it in terms of what it can do, but they do also mention that it is limited by a quota, although they also say you can contact them if you're developing a FOSS project and want to use the API:

https://realfavicongenerator.net/api/download_website_favicon

They also have an analysis section, which may assist in being able to select various sizes? I can't say for sure because the link to the documentation is 404ing...

  1. I also ran across this post on StachOverflow, which lists several sites:

https://stackoverflow.com/questions/5119041/how-can-i-get-a-web-sites-favicon

but it includes one I did not ever know existed:

http://www.google.com/s2/favicons

Along with a lot of other sites.

Not trying to imply you haven't already seen them - just posting in case you haven't yet seen them ;)

@JohnLGalt If I really go that route, I will probably try to create a similar site.
Maybe even develop an interface and allow the use of other sites.

@JohnLGalt If I really go that route, I will probably try to create a similar site.
Maybe even develop an interface and allow the use of other sites.

See, I had a feeling you would not be content to use something else developed by someone else lol.

I'm now (more than ever) curious to see how much bw an API / website-based approach would actually use....

+1 for limiting the size or resizing the icons. This is by far the best icon downloader for KeePass, but the size of some icons makes the kdbx-file way too large.

When I initially started this feature request, I didn't have a good overview about the various ways websites implement different icons, icon sizes, icon descriptions and sometimes even obfuscate their icons to prevent grabbing/downloading them. Now that I have read all your answers and suggestions and after doing some research on my own, I have a better picture.

Adding such a size-choosing option (or even building an own webservice with an API for that) would probably be a nice feature, but it's maybe not worth the effort. I mean, your PlugIn works fine!

@JohnLGalt There is no better way to learn something new ;)

@Marrib Still on the plans! Not sure when then...

Feature added on release v1.2.5.0.

WOW! Amazing! Thanks!