| 2256 status_box->buddy_icon = NULL; |
2256 status_box->buddy_icon = NULL; |
| 2257 status_box->buddy_icon_hover = NULL; |
2257 status_box->buddy_icon_hover = NULL; |
| 2258 |
2258 |
| 2259 if (status_box->buddy_icon_img != NULL) |
2259 if (status_box->buddy_icon_img != NULL) |
| 2260 { |
2260 { |
| |
2261 GdkPixbuf *buf, *scale; |
| |
2262 int scale_width, scale_height; |
| 2261 GdkPixbufLoader *loader = gdk_pixbuf_loader_new(); |
2263 GdkPixbufLoader *loader = gdk_pixbuf_loader_new(); |
| 2262 g_signal_connect(G_OBJECT(loader), "size-prepared", G_CALLBACK(pixbuf_size_prepared_cb), NULL); |
2264 g_signal_connect(G_OBJECT(loader), "size-prepared", G_CALLBACK(pixbuf_size_prepared_cb), NULL); |
| 2263 gdk_pixbuf_loader_write(loader, purple_imgstore_get_data(status_box->buddy_icon_img), |
2265 gdk_pixbuf_loader_write(loader, purple_imgstore_get_data(status_box->buddy_icon_img), |
| 2264 purple_imgstore_get_size(status_box->buddy_icon_img), NULL); |
2266 purple_imgstore_get_size(status_box->buddy_icon_img), NULL); |
| 2265 gdk_pixbuf_loader_close(loader, NULL); |
2267 gdk_pixbuf_loader_close(loader, NULL); |
| 2266 status_box->buddy_icon = gdk_pixbuf_loader_get_pixbuf(loader); |
2268 buf = gdk_pixbuf_loader_get_pixbuf(loader); |
| 2267 if (status_box->buddy_icon) |
2269 scale_width = gdk_pixbuf_get_width(buf); |
| 2268 g_object_ref(status_box->buddy_icon); |
2270 scale_height = gdk_pixbuf_get_height(buf); |
| |
2271 scale = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, scale_width, scale_height); |
| |
2272 gdk_pixbuf_fill(scale, 0x00000000); |
| |
2273 gdk_pixbuf_copy_area(buf, 0, 0, scale_width, scale_height, scale, 0, 0); |
| |
2274 if (pidgin_gdk_pixbuf_is_opaque(scale)) |
| |
2275 pidgin_gdk_pixbuf_make_round(scale); |
| |
2276 status_box->buddy_icon = scale; |
| 2269 g_object_unref(loader); |
2277 g_object_unref(loader); |
| 2270 } |
2278 } |
| 2271 |
2279 |
| 2272 if (status_box->buddy_icon == NULL) |
2280 if (status_box->buddy_icon == NULL) |
| 2273 { |
2281 { |