From c8375c011376d870f75ae438ffdf2f9b435ecad4 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 3 Nov 2008 16:39:20 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20559081=20=E2=80=93=20JPEG=20Save=20dialog?= =?UTF-8?q?=20preview=20should=20adjust=20size=20units?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-11-03 Sven Neumann Bug 559081 – JPEG Save dialog preview should adjust size units * plug-ins/file-jpeg/jpeg-save.c: use g_format_size_for_display() to display the JPEG file size. svn path=/trunk/; revision=27532 --- ChangeLog | 7 +++++++ plug-ins/file-jpeg/jpeg-save.c | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88a50ae31a..033cb5fc25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-03 Sven Neumann + + Bug 559081 – JPEG Save dialog preview should adjust size units + + * plug-ins/file-jpeg/jpeg-save.c: use g_format_size_for_display() + to display the JPEG file size. + 2008-11-03 Michael Natterer * app/core/gimpitem.[ch]: renamed diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c index 8f779310fc..ba7fd513b9 100644 --- a/plug-ins/file-jpeg/jpeg-save.c +++ b/plug-ins/file-jpeg/jpeg-save.c @@ -192,14 +192,14 @@ background_jpeg_save (PreviewPersistent *pp) /* display the preview stuff */ if (!pp->abort_me) { - struct stat buf; - gchar temp[128]; + struct stat buf; + gchar *text; g_stat (pp->file_name, &buf); - g_snprintf (temp, sizeof (temp), - _("File size: %02.01f kB"), - (gdouble) (buf.st_size) / 1024.0); - gtk_label_set_text (GTK_LABEL (preview_size), temp); + text = g_strdup_printf (_("File size: %s"), + g_format_size_for_display (buf.st_size)); + gtk_label_set_text (GTK_LABEL (preview_size), text); + g_free (text); /* and load the preview */ load_image (pp->file_name, GIMP_RUN_NONINTERACTIVE, TRUE, NULL);