diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-05-09 20:08:09 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-10 18:44:57 +0100 |
commit | 13577a1ec82a9443ddb1943582a4d387ba15a99f (patch) | |
tree | 2ecaec84d1322954df8f786fe8204b6b632d3825 /fitz/text_output.c | |
parent | 81626cb122701420a15dae49ed0e7ec3c442e9d3 (diff) | |
download | mupdf-13577a1ec82a9443ddb1943582a4d387ba15a99f.tar.xz |
Tweak png outputting functions.
Allow us to get an image as a png in a buffer.
Diffstat (limited to 'fitz/text_output.c')
-rw-r--r-- | fitz/text_output.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fitz/text_output.c b/fitz/text_output.c index 7aceddef..6942eb67 100644 --- a/fitz/text_output.c +++ b/fitz/text_output.c @@ -258,15 +258,10 @@ fz_print_text_page_html(fz_context *ctx, fz_output *out, fz_text_page *page) break; default: { - fz_pixmap *pix = fz_image_get_pixmap(ctx, image->image, image->image->w, image->image->h); - fz_buffer *buf = fz_new_buffer(ctx, 1024); - fz_output *out2 = fz_new_output_with_buffer(ctx, buf); - fz_output_pixmap_to_png(ctx, pix, out2, 0); - fz_close_output(out2); + fz_buffer *buf = fz_image_as_png(ctx, image->image, image->image->w, image->image->h); fz_printf(out, "image/png;base64,"); send_data_base64(out, buf); fz_drop_buffer(ctx, buf); - fz_drop_pixmap(ctx, pix); break; } } |