Index: gdk-pixbuf-io.c =================================================================== RCS file: /cvs/gnome/gtk+/gdk-pixbuf/gdk-pixbuf-io.c,v retrieving revision 1.109 diff -u -p -r1.109 gdk-pixbuf-io.c --- gdk-pixbuf-io.c 24 May 2005 17:09:56 -0000 1.109 +++ gdk-pixbuf-io.c 1 Jul 2005 08:40:03 -0000 @@ -939,6 +939,11 @@ size_prepared_cb (GdkPixbufLoader *loade g_return_if_fail (width > 0 && height > 0); + if (info->width == -1) + info->width = width; + if (info->height = -1) + info->height = height; + if(info->preserve_aspect_ratio) { if ((double)height * (double)info->width > (double)width * (double)info->height) { @@ -959,8 +964,8 @@ size_prepared_cb (GdkPixbufLoader *loade /** * gdk_pixbuf_new_from_file_at_size: * @filename: Name of file to load, in the GLib file name encoding - * @width: The width the image should have - * @height: The height the image should have + * @width: The width the image should have or -1 to preserve the width + * @height: The height the image should have or -1 to preserve the height * @error: Return location for an error * * Creates a new pixbuf by loading an image from a file. The file format is @@ -1018,8 +1023,8 @@ gdk_pixbuf_new_from_file_at_size (const /** * gdk_pixbuf_new_from_file_at_scale: * @filename: Name of file to load, in the GLib file name encoding - * @width: The width the image should have - * @height: The height the image should have + * @width: The width the image should have or -1 to preserve the width + * @height: The height the image should have or -1 to preserve the height * @preserve_aspect_ratio: %TRUE to preserve the image's aspect ratio * @error: Return location for an error * @@ -1057,7 +1062,8 @@ gdk_pixbuf_new_from_file_at_scale (const } info; g_return_val_if_fail (filename != NULL, NULL); - g_return_val_if_fail (width > 0 && height > 0, NULL); + g_return_val_if_fail (width > 0 || width == -1, NULL); + g_return_val_if_fail (height > 0 || height == -1, NULL); f = g_fopen (filename, "rb"); if (!f) {