aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-08-13 23:30:24 +0800
committerChristian Persch <chpe@src.gnome.org>2005-08-13 23:30:24 +0800
commitc2b5b48de565a5d7df532e48f9fcb44bd8aaacd9 (patch)
treeda2db2974a6af4d8c755fe42169ce5d196011156
parent5053d123082a01a657b3f34538702a8245aa3d34 (diff)
downloadgsoc2013-epiphany-c2b5b48de565a5d7df532e48f9fcb44bd8aaacd9.tar
gsoc2013-epiphany-c2b5b48de565a5d7df532e48f9fcb44bd8aaacd9.tar.gz
gsoc2013-epiphany-c2b5b48de565a5d7df532e48f9fcb44bd8aaacd9.tar.bz2
gsoc2013-epiphany-c2b5b48de565a5d7df532e48f9fcb44bd8aaacd9.tar.lz
gsoc2013-epiphany-c2b5b48de565a5d7df532e48f9fcb44bd8aaacd9.tar.xz
gsoc2013-epiphany-c2b5b48de565a5d7df532e48f9fcb44bd8aaacd9.tar.zst
gsoc2013-epiphany-c2b5b48de565a5d7df532e48f9fcb44bd8aaacd9.zip
Reject favicons that are < 12x12.
2005-08-13 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-favicon-cache.c: (ephy_favicon_cache_get): Reject favicons that are < 12x12.
-rw-r--r--ChangeLog6
-rw-r--r--doc/reference/tmpl/ephy-embed.sgml2
-rw-r--r--embed/ephy-favicon-cache.c15
3 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 18bb930ab..6780c88a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2005-08-13 Christian Persch <chpe@cvs.gnome.org>
+ * embed/ephy-favicon-cache.c: (ephy_favicon_cache_get):
+
+ Reject favicons that are < 12x12.
+
+2005-08-13 Christian Persch <chpe@cvs.gnome.org>
+
* embed/downloader-view.c: (update_download_row):
Don't display (guint64)-1 as filesize if it's not known yet.
diff --git a/doc/reference/tmpl/ephy-embed.sgml b/doc/reference/tmpl/ephy-embed.sgml
index d2f2bf874..fa21eecc5 100644
--- a/doc/reference/tmpl/ephy-embed.sgml
+++ b/doc/reference/tmpl/ephy-embed.sgml
@@ -266,6 +266,8 @@ be done by casting).
@:
@:
@:
+@:
+@:
@:
<!-- ##### SIGNAL EphyEmbed::ge-search-key-press ##### -->
diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c
index e720bb7a8..f06cfa41a 100644
--- a/embed/ephy-favicon-cache.c
+++ b/embed/ephy-favicon-cache.c
@@ -583,6 +583,7 @@ ephy_favicon_cache_get (EphyFaviconCache *cache,
char *pix_file;
GdkPixbuf *pixbuf = NULL;
guint checklevel = NEEDS_MASK;
+ int width, height;
if (url == NULL) return NULL;
@@ -810,8 +811,18 @@ ephy_favicon_cache_get (EphyFaviconCache *cache,
return NULL;
}
- if (gdk_pixbuf_get_width (pixbuf) > 16 ||
- gdk_pixbuf_get_height (pixbuf) > 16)
+ width = gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+
+ /* Reject icons that are too small */
+ if (width < 12 || height < 12)
+ {
+ entry->load_failed = TRUE;
+ return NULL;
+ }
+
+ /* Scale icons that are too big */
+ if (width > 16 || height > 16)
{
GdkPixbuf *scaled = gdk_pixbuf_scale_simple (pixbuf, 16, 16,
GDK_INTERP_NEAREST);