From 16911233da82601e2df6b0af49fc2136db38535d Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 6 Jan 2017 17:49:19 +0000 Subject: Fix /dev/null slowdown. In commit 80308eae9964e71b66a18f3de6ebcd2ebf0d306b ("Regularize band writer interface"), I inadvertently slowed down outputting to /dev/null. Fixed here. Also take the opportunity to speed ppm/pnm files writing in general if we don't need to collate. --- source/fitz/output-pcl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/fitz/output-pcl.c') diff --git a/source/fitz/output-pcl.c b/source/fitz/output-pcl.c index 4485453a..4eb620f3 100644 --- a/source/fitz/output-pcl.c +++ b/source/fitz/output-pcl.c @@ -782,6 +782,9 @@ color_pcl_write_band(fz_context *ctx, fz_band_writer *writer_, int stride, int b unsigned char *curr; unsigned char *comp; + if (!out) + return; + ds = w * 3; ss = w * 4; @@ -1149,6 +1152,9 @@ mono_pcl_write_band(fz_context *ctx, fz_band_writer *writer_, int ss, int band_s int out_count; const fz_pcl_options *pcl; + if (!out) + return; + num_blank_lines = writer->num_blank_lines; rmask = ~0 << (-w & 7); line_size = (w + 7)/8; -- cgit v1.2.3