merged fix for bug #92394 from stable branch.

2002-09-03  Sven Neumann  <sven@gimp.org>

	* plug-ins/gimpressionist/ppmtool.c (saveppm): merged fix for
	bug #92394 from stable branch.
This commit is contained in:
Sven Neumann 2002-09-03 13:09:58 +00:00 committed by Sven Neumann
parent 0d91f5a8c3
commit e0de275828
4 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2002-09-03 Sven Neumann <sven@gimp.org>
* plug-ins/gimpressionist/ppmtool.c (saveppm): merged fix for
bug #92394 from stable branch.
2002-09-02 Michael Natterer <mitch@gimp.org> 2002-09-02 Michael Natterer <mitch@gimp.org>
* app/core/gimpviewable.c: small speedup: use * app/core/gimpviewable.c: small speedup: use

View File

@ -11,8 +11,10 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <errno.h>
#include "ppmtool.h" #include "ppmtool.h"
#include "gimpressionist.h" #include "gimpressionist.h"
#include "libgimp/stdplugins-intl.h"
int readline(FILE *f, char *buffer, int len) 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) void saveppm(struct ppm *p, const char *fn)
{ {
FILE *f = fopen(fn, "wb"); 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); if (!f)
fclose(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) void edgepad(struct ppm *p, int left,int right, int top, int bottom)

View File

@ -1,3 +1,7 @@
2002-09-03 Sven Neumann <sven@gimp.org>
* POTFILES.in: added missing file.
2002-08-31 Christian Neumair <chris@gnome-de.org> 2002-08-31 Christian Neumair <chris@gnome-de.org>
* de.po: Updated German translation. * de.po: Updated German translation.

View File

@ -183,6 +183,7 @@ plug-ins/gimpressionist/orientation.c
plug-ins/gimpressionist/orientmap.c plug-ins/gimpressionist/orientmap.c
plug-ins/gimpressionist/paper.c plug-ins/gimpressionist/paper.c
plug-ins/gimpressionist/placement.c plug-ins/gimpressionist/placement.c
plug-ins/gimpressionist/ppmtool.c
plug-ins/gimpressionist/presets.c plug-ins/gimpressionist/presets.c
plug-ins/gimpressionist/preview.c plug-ins/gimpressionist/preview.c
plug-ins/gimpressionist/repaint.c plug-ins/gimpressionist/repaint.c