From Tor Lillqvist <tml@novell.com>:

Open output PNG files in binary mode.
This commit is contained in:
Kristian Høgsberg 2005-03-17 13:13:56 +00:00
parent e66e4c7b8c
commit 58420806bb
3 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2005-03-17 Kristian Høgsberg <krh@redhat.com>
From Tor Lillqvist <tml@novell.com>:
* test/cairo_test.c (cairo_test): Open output PNG files in binary
mode.
2005-03-17 Owen Taylor <otaylor@redhat.com>
* src/cairo.h src/cairo_surface.c src/cairo-xlib.h

View file

@ -159,7 +159,7 @@ cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw)
return CAIRO_TEST_SUCCESS;
}
png_file = fopen (png_name, "w");
png_file = fopen (png_name, "wb");
write_png_argb32 (png_buf, png_file, test->width, test->height, stride);
fclose (png_file);
@ -205,7 +205,7 @@ cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw)
log_file = fopen (log_name, "a");
fprintf (log_file, "Error: %d pixels differ from reference image %s\n",
pixels_changed, ref_name);
png_file = fopen (diff_name, "w");
png_file = fopen (diff_name, "wb");
write_png_argb32 (diff_buf, png_file, test->width, test->height, stride);
fclose (png_file);
fclose (log_file);

View file

@ -159,7 +159,7 @@ cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw)
return CAIRO_TEST_SUCCESS;
}
png_file = fopen (png_name, "w");
png_file = fopen (png_name, "wb");
write_png_argb32 (png_buf, png_file, test->width, test->height, stride);
fclose (png_file);
@ -205,7 +205,7 @@ cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw)
log_file = fopen (log_name, "a");
fprintf (log_file, "Error: %d pixels differ from reference image %s\n",
pixels_changed, ref_name);
png_file = fopen (diff_name, "w");
png_file = fopen (diff_name, "wb");
write_png_argb32 (diff_buf, png_file, test->width, test->height, stride);
fclose (png_file);
fclose (log_file);