From e0de275828f6591e94a92cb8f6e04b89913f7a07 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 3 Sep 2002 13:09:58 +0000 Subject: [PATCH] merged fix for bug #92394 from stable branch. 2002-09-03 Sven Neumann * plug-ins/gimpressionist/ppmtool.c (saveppm): merged fix for bug #92394 from stable branch. --- ChangeLog | 5 +++++ plug-ins/gimpressionist/ppmtool.c | 18 ++++++++++++++---- po-plug-ins/ChangeLog | 4 ++++ po-plug-ins/POTFILES.in | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 493bb6deba..679d768e43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-09-03 Sven Neumann + + * plug-ins/gimpressionist/ppmtool.c (saveppm): merged fix for + bug #92394 from stable branch. + 2002-09-02 Michael Natterer * app/core/gimpviewable.c: small speedup: use diff --git a/plug-ins/gimpressionist/ppmtool.c b/plug-ins/gimpressionist/ppmtool.c index 5fe42effb9..6353e5df84 100644 --- a/plug-ins/gimpressionist/ppmtool.c +++ b/plug-ins/gimpressionist/ppmtool.c @@ -11,8 +11,10 @@ #include #include #include +#include #include "ppmtool.h" #include "gimpressionist.h" +#include "libgimp/stdplugins-intl.h" int readline(FILE *f, char *buffer, int len) { @@ -489,10 +491,18 @@ void pad(struct ppm *p, int left,int right, int top, int bottom, guchar *bg) void saveppm(struct ppm *p, const char *fn) { - FILE *f = fopen(fn, "wb"); - fprintf(f, "P6\n%d %d\n255\n", p->width, p->height); - fwrite(p->col, p->width * 3 * p->height, 1, f); - fclose(f); + FILE *f = fopen (fn, "wb"); + + if (!f) + { + g_message (_("GIMPressionist:\nFailed to save PPM file '%s':\n%s"), + fn, g_strerror (errno)); + return; + } + + fprintf (f, "P6\n%d %d\n255\n", p->width, p->height); + fwrite (p->col, p->width * 3 * p->height, 1, f); + fclose (f); } void edgepad(struct ppm *p, int left,int right, int top, int bottom) diff --git a/po-plug-ins/ChangeLog b/po-plug-ins/ChangeLog index a8846695e6..9bca185c35 100644 --- a/po-plug-ins/ChangeLog +++ b/po-plug-ins/ChangeLog @@ -1,3 +1,7 @@ +2002-09-03 Sven Neumann + + * POTFILES.in: added missing file. + 2002-08-31 Christian Neumair * de.po: Updated German translation. diff --git a/po-plug-ins/POTFILES.in b/po-plug-ins/POTFILES.in index c6a5adf3a6..9d43f685ba 100644 --- a/po-plug-ins/POTFILES.in +++ b/po-plug-ins/POTFILES.in @@ -183,6 +183,7 @@ plug-ins/gimpressionist/orientation.c plug-ins/gimpressionist/orientmap.c plug-ins/gimpressionist/paper.c plug-ins/gimpressionist/placement.c +plug-ins/gimpressionist/ppmtool.c plug-ins/gimpressionist/presets.c plug-ins/gimpressionist/preview.c plug-ins/gimpressionist/repaint.c