107
107
g_signal_connect(priv->album_art, "expose-event",
108
108
G_CALLBACK(metadata_image_expose),
110
gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
112
111
gtk_box_pack_start (GTK_BOX (priv->hbox),
190
189
if(g_string_equal(priv->image_path, priv->old_image_path) == FALSE ||
191
190
priv->theme_change_occured == TRUE){
192
191
priv->theme_change_occured = FALSE;
193
GdkPixbuf* orig_pixbuf;
194
orig_pixbuf = gdk_pixbuf_new_from_file(priv->image_path->str, NULL);
193
pixbuf = gdk_pixbuf_new_from_file_at_size(priv->image_path->str, 60, 60, NULL);
195
194
//g_debug("metadata_load_new_image -> pixbuf from %s",
196
195
// priv->image_path->str);
197
if(GDK_IS_PIXBUF(orig_pixbuf) == FALSE){
196
if(GDK_IS_PIXBUF(pixbuf) == FALSE){
198
197
//g_debug("problem loading the downloaded image just use the placeholder instead");
198
gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
199
199
draw_album_art_placeholder(metadata);
203
pixbuf = gdk_pixbuf_scale_simple(orig_pixbuf,60, 60, GDK_INTERP_BILINEAR);
204
202
gtk_image_set_from_pixbuf(GTK_IMAGE(priv->album_art), pixbuf);
203
gtk_widget_set_size_request(GTK_WIDGET(priv->album_art),
204
gdk_pixbuf_get_width(pixbuf),
205
gdk_pixbuf_get_height(pixbuf));
205
207
g_string_erase(priv->old_image_path, 0, -1);
206
208
g_string_overwrite(priv->old_image_path, 0, priv->image_path->str);
208
g_object_unref(pixbuf);
209
g_object_unref(orig_pixbuf);
210
g_object_unref(pixbuf);
214
gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
213
215
draw_album_art_placeholder(metadata);