static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfile)
{
+ GtkAllocation allocation;
GdkPixbufAnimation *animation = NULL;
GdkPixbuf *pixbuf = NULL;
GError *error = NULL;
g_object_unref(animation);
animation = NULL;
- if (imageviewer->resize_img)
+ if (imageviewer->resize_img) {
+ gtk_widget_get_allocation(
+ gtk_widget_get_parent(imageviewer->notebook), &allocation);
pixbuf = claws_load_pixbuf_fitting(pixbuf,
- imageviewer->notebook->parent->allocation.width,
- imageviewer->notebook->parent->allocation.height);
+ allocation.width,
+ allocation.height);
+ }
else
pixbuf = claws_load_pixbuf_fitting(pixbuf, -1, -1);
}