Commit de68f16e authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

added some (disabled) debug output.

2004-10-07  Sven Neumann  <sven@gimp.org>

	* libgimpthumb/gimpthumbnail.c: added some (disabled) debug output.

	* app/widgets/gimpviewrenderer-frame.[ch]: added a way to retrieve
	the size of the frame borders.

	* app/widgets/gimpthumbbox.c: don't set an arbitrary padding but
	exactly the size of the frame borders. Otherwise we get large
	thumbnails (scaled down) if we request normal sized ones.
parent cb8cb6e4
2004-10-07 Sven Neumann <sven@gimp.org>
* libgimpthumb/gimpthumbnail.c: added some (disabled) debug output.
* app/widgets/gimpviewrenderer-frame.[ch]: added a way to retrieve
the size of the frame borders.
* app/widgets/gimpthumbbox.c: don't set an arbitrary padding but
exactly the size of the frame borders. Otherwise we get large
thumbnails (scaled down) if we request normal sized ones.
2004-10-07 Kevin Cozens <kcozens@cvs.gimp.org>
* plug-ins/script-fu/scripts/selection-round.scm: Changed deprecated
......
......@@ -36,8 +36,9 @@
#include "file/file-utils.h"
#include "gimpfiledialog.h" /* eek */
#include "gimpview.h"
#include "gimpthumbbox.h"
#include "gimpview.h"
#include "gimpviewrenderer-frame.h"
#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
......@@ -277,6 +278,7 @@ gimp_thumb_box_new (Gimp *gimp)
GtkWidget *button;
GtkWidget *label;
gchar *str;
gint h, v;
GtkRequisition info_requisition;
GtkRequisition thumb_progress_requisition;
GtkRequisition progress_requisition;
......@@ -343,9 +345,11 @@ gimp_thumb_box_new (Gimp *gimp)
G_CALLBACK (gimp_thumb_box_imagefile_info_changed),
box);
gimp_view_renderer_get_frame_size (&h, &v);
box->preview = gimp_view_new (GIMP_VIEWABLE (box->imagefile),
/* add some padding here for the shadow frame */
gimp->config->thumbnail_size + 16,
/* add padding for the shadow frame */
gimp->config->thumbnail_size + MAX (h, v),
0, FALSE);
gtk_box_pack_start (GTK_BOX (hbox), box->preview, TRUE, FALSE, 10);
gtk_widget_show (box->preview);
......
......@@ -269,3 +269,24 @@ gimp_view_renderer_get_frame_pixbuf (GimpViewRenderer *renderer,
return frame;
}
/* This API is somewhat weird but GimpThumbBox needs these values so
* it can request the GimpImageFile view in the proper size.
*/
void
gimp_view_renderer_get_frame_size (gint *horizontal,
gint *vertical)
{
GimpViewRendererClass *class;
class = g_type_class_ref (GIMP_TYPE_VIEW_RENDERER);
if (horizontal)
*horizontal = class->frame_left + class->frame_right;
if (vertical)
*vertical = class->frame_top + class->frame_bottom;
g_type_class_unref (class);
}
......@@ -28,5 +28,8 @@ GdkPixbuf * gimp_view_renderer_get_frame_pixbuf (GimpViewRenderer *renderer,
gint width,
gint height);
void gimp_view_renderer_get_frame_size (gint *width,
gint *height);
#endif /* __GIMP_VIEW_RENDERER_FRAME_H__ */
......@@ -797,6 +797,10 @@ gimp_thumbnail_load_thumb (GimpThumbnail *thumbnail,
if (! pixbuf)
return NULL;
#ifdef GIMP_THUMB_DEBUG
g_printerr ("thumbnail loaded from %s\n", thumbnail->thumb_filename);
#endif
g_object_freeze_notify (G_OBJECT (thumbnail));
/* URI and mtime from the thumbnail need to match our file */
......@@ -970,6 +974,10 @@ gimp_thumbnail_save_thumb (GimpThumbnail *thumbnail,
if (success)
{
#ifdef GIMP_THUMB_DEBUG
g_printerr ("thumbnail saved to file %s\n", name);
#endif
success = (chmod (name, 0600) == 0);
if (success)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment