diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2009-07-21 23:44:28 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2009-07-21 23:44:28 +0000 |
commit | cfa25f0812d09e674ec78fa3d4f69c157b5e3137 (patch) | |
tree | 54cb9e0543993032914a87b4dad6625bac4de7dd /net-misc/twitux/files | |
parent | Stable for HPPA (bug #277194). (diff) | |
download | gentoo-2-cfa25f0812d09e674ec78fa3d4f69c157b5e3137.tar.gz gentoo-2-cfa25f0812d09e674ec78fa3d4f69c157b5e3137.tar.bz2 gentoo-2-cfa25f0812d09e674ec78fa3d4f69c157b5e3137.zip |
Handle large avatars wrt #265813, thanks to Alexandre Nuno Milheiro.
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/twitux/files')
-rw-r--r-- | net-misc/twitux/files/twitux-0.69-large_avatars.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/net-misc/twitux/files/twitux-0.69-large_avatars.patch b/net-misc/twitux/files/twitux-0.69-large_avatars.patch new file mode 100644 index 000000000000..422e59351562 --- /dev/null +++ b/net-misc/twitux/files/twitux-0.69-large_avatars.patch @@ -0,0 +1,30 @@ +Handle large avatars. http://bugs.gentoo.org/show_bug.cgi?id=265813. + +diff -abBU 1 -rP twitux-0.69/src/twitux-app.c twitux-0.69-r1/src/twitux-app.c +--- twitux-0.69/src/twitux-app.c 2009-01-25 01:24:00.000000000 +0000 ++++ twitux-0.69-r1/src/twitux-app.c 2009-04-12 00:15:23.000000000 +0100 +@@ -68,2 +68,3 @@ + #define TYPE_TWITTER "twitter" ++#define MAX_SIZE 73 + +@@ -1472,4 +1473,20 @@ + ++ int height, width; + pixbuf = gdk_pixbuf_new_from_file (file, &error); ++ height = gdk_pixbuf_get_height(pixbuf); ++ width = gdk_pixbuf_get_width(pixbuf); + ++ if (height > MAX_SIZE || width > MAX_SIZE) ++ { ++ double ratio; ++ GdkPixbuf *scaled; ++ ++ ratio = width/(height*1.0); ++ if (ratio >= 1.0) /* width is bigger */ ++ scaled = gdk_pixbuf_scale_simple(pixbuf, MAX_SIZE, MAX_SIZE/ratio,GDK_INTERP_BILINEAR); ++ else ++ scaled = gdk_pixbuf_scale_simple(pixbuf, MAX_SIZE*ratio, MAX_SIZE,GDK_INTERP_BILINEAR); ++ g_object_unref(pixbuf); ++ pixbuf = scaled; ++ } + if (!pixbuf){ |