Share

Twitux

Tracker: Bugs

5 Twitux doesn't cope gracefully with very large user icons - ID: 2585171
Last Update: Comment added ( bpepple )

Scenario: Some twitter users have very large avatar icons -- hundreds of
pixels to a side.

Problem: The first column in the twitux two-column GUI expands to an
enormous size to accommodate the large user icon, which renders the
interface much less useful. (Unless you maximize the twitux window, you
won't see the text of any tweets!)

Ideal fix: scale user icons to a sensible size before rendering.
Alternatively: add option to disable rendering of icons.


Nobody/Anonymous ( nobody ) - 2009-02-10 13:52

5

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comments ( 3 )

Date: 2009-02-12 02:52
Sender: bpepple

This has been fixed in svn rev. 372, and will be available in our next
release.


Date: 2009-02-10 16:44
Sender: palfreyAccepting Donations

Whoops. Slightly old version... "#define MAX_SIZE 73" should possibly be
"#define MAX_SIZE 75" (although 73 also works.)


Date: 2009-02-10 16:43
Sender: palfreyAccepting Donations

Here's a fix that scales all user icons to no more than 75 pixels if they
exceed that size. 75 is a picked-out-of-the-air number based on looking at
a few sanely sized icons. Also, for some deranged reason I can't attach
this patch as a file so here's it copy+pasted.

diff --git a/src/twitux-app.c b/src/twitux-app.c
index 89f9da4..055e029 100644
--- a/src/twitux-app.c
+++ b/src/twitux-app.c
@@ -66,6 +66,7 @@
#define DEBUG_QUIT

#define TYPE_TWITTER "twitter"
+#define MAX_SIZE 73

struct _TwituxAppPriv {
/* Main widgets */
@@ -1469,8 +1470,25 @@ twitux_app_set_image (const gchar *file,
GtkListStore *store;
GdkPixbuf *pixbuf;
GError *error = NULL;
+ 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){
twitux_debug (DEBUG_DOMAIN_SETUP, "Image error: %s: %s",


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-02-12 02:52 bpepple
resolution_id None 2009-02-12 02:52 bpepple
allow_comments 1 2009-02-12 02:52 bpepple
close_date - 2009-02-12 02:52 bpepple