[cairo-commit] src/cairo-pdf-surface.c
Adrian Johnson
ajohnson at kemper.freedesktop.org
Fri Nov 27 04:50:16 PST 2009
src/cairo-pdf-surface.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
New commits:
commit 02d7e123d640d62db46ef03d7faecbc7598444e1
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Fri Nov 27 23:11:56 2009 +1030
PDF: Remove extraneous \n from end of jpeg/jp2 data
PDF requires a '\n' between the end of stream data and the "endstream"
that is not included in the stream length. Ensure this is always added
in _close_stream where it is not included in the stream length.
Previously the jpeg/jp2 embedding functions were adding the '\n'. This
resulted in the '\n' becoming part of the stream data.
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 62178dc..e8335f0 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1332,13 +1332,12 @@ _cairo_pdf_surface_close_stream (cairo_pdf_surface_t *surface)
surface->output = surface->pdf_stream.old_output;
_cairo_pdf_operators_set_stream (&surface->pdf_operators, surface->output);
surface->pdf_stream.old_output = NULL;
- _cairo_output_stream_printf (surface->output,
- "\n");
}
length = _cairo_output_stream_get_position (surface->output) -
surface->pdf_stream.start_offset;
_cairo_output_stream_printf (surface->output,
+ "\n"
"endstream\n"
"endobj\n");
@@ -2010,7 +2009,6 @@ _cairo_pdf_surface_emit_jpx_image (cairo_pdf_surface_t *surface,
return status;
_cairo_output_stream_write (surface->output, mime_data, mime_data_length);
- _cairo_output_stream_printf (surface->output, "\n");
status = _cairo_pdf_surface_close_stream (surface);
return status;
@@ -2058,7 +2056,6 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t *surface,
return status;
_cairo_output_stream_write (surface->output, mime_data, mime_data_length);
- _cairo_output_stream_printf (surface->output, "\n");
status = _cairo_pdf_surface_close_stream (surface);
return status;
More information about the cairo-commit
mailing list