Prefer 32px favicons

This commit is contained in:
relikd
2019-08-06 13:28:05 +02:00
parent 4ae7b09944
commit 9f2f1e67f5
3 changed files with 40 additions and 35 deletions

View File

@@ -475,13 +475,17 @@ static BOOL _nextUpdateIsForced = NO;
else if (meta.iconLinks.count > 0) {
// at least any url (even if all items in list have size 0)
NSString *iconURL = meta.iconLinks.firstObject.link;
// we dont need much, lets find the smallest icon ...
int smallest = 9001;
double best = DBL_MAX;
for (RSHTMLMetadataIconLink *icon in meta.iconLinks) {
int size = (int)[icon getSize].width;
if (size > 0 && size < smallest) {
smallest = size;
iconURL = icon.link;
CGSize size = [icon getSize];
CGFloat area = size.width * size.height;
if (area > 0) {
// find icon with closest matching size 32x32
double match = fabs(log10(area) - log10(32*32));
if (match < best) {
best = match;
iconURL = icon.link;
}
}
}
if (iconURL && iconURL.length > 0)

View File

@@ -60,7 +60,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9740</string>
<string>9750</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.news</string>
<key>LSMinimumSystemVersion</key>