summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-10-30 00:34:17 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-11-23 19:45:47 +0800
commite0fa7401cacd6a11ac8471fea35944f33f1e0070 (patch)
tree99569a5a5b45fbab38ae10f96209e08d48b16824
parentc7b3ab9553dea50ae7151d9847c1b62a0213f275 (diff)
downloadmupdf-e0fa7401cacd6a11ac8471fea35944f33f1e0070.tar.xz
Try drawing all pages in a document in mudraw if ignoring errors.
-rw-r--r--source/tools/mudraw.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index 7b77f195..6134b12d 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -1042,10 +1042,30 @@ static void drawrange(fz_context *ctx, fz_document *doc, const char *range)
{
if (spage < epage)
for (page = spage; page <= epage; page++)
- drawpage(ctx, doc, page);
+ {
+ fz_try(ctx)
+ drawpage(ctx, doc, page);
+ fz_catch(ctx)
+ {
+ if (ignore_errors)
+ fz_warn(ctx, "ignoring error on page %d in '%s'", page, filename);
+ else
+ fz_rethrow(ctx);
+ }
+ }
else
for (page = spage; page >= epage; page--)
- drawpage(ctx, doc, page);
+ {
+ fz_try(ctx)
+ drawpage(ctx, doc, page);
+ fz_catch(ctx)
+ {
+ if (ignore_errors)
+ fz_warn(ctx, "ignoring error on page %d in '%s'", page, filename);
+ else
+ fz_rethrow(ctx);
+ }
+ }
}
}