summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-11-20 12:50:52 +0100
committerTor Andersson <tor.andersson@artifex.com>2015-11-24 16:56:26 +0100
commit7ab039de8626a3052483aeb806186aaa4079e925 (patch)
treea64aa57c99c489bb4cb1ba968cbd0fc5b0776a62
parent7ea84e45f743381e2b47d94a3718a400904ba45f (diff)
downloadghostpdl-7ab039de8626a3052483aeb806186aaa4079e925.tar.gz
xps: Add more warning messages.
-rw-r--r--xps/xpsdoc.c5
-rw-r--r--xps/xpstile.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/xps/xpsdoc.c b/xps/xpsdoc.c
index bc790f838..28ffc1a4b 100644
--- a/xps/xpsdoc.c
+++ b/xps/xpsdoc.c
@@ -190,6 +190,7 @@ xps_parse_metadata_imp(void *zp, char *name, char **atts)
char tgtbuf[1024];
char *target = NULL;
char *type = NULL;
+ char *id = NULL;
for (i = 0; atts[i]; i += 2)
{
@@ -197,6 +198,8 @@ xps_parse_metadata_imp(void *zp, char *name, char **atts)
target = atts[i + 1];
if (!strcmp(atts[i], "Type"))
type = atts[i + 1];
+ if (!strcmp(atts[i], "Id"))
+ id = atts[i + 1];
}
if (target && type)
@@ -205,6 +208,8 @@ xps_parse_metadata_imp(void *zp, char *name, char **atts)
if (!strcmp(type, REL_START_PART) ||
!strcmp(type, REL_START_PART_OXPS))
ctx->start_part = xps_strdup(ctx, tgtbuf);
+ if (!id)
+ gs_warn1("missing relationship Id for %s", target);
}
}
diff --git a/xps/xpstile.c b/xps/xpstile.c
index 89ac2be38..684ccf67e 100644
--- a/xps/xpstile.c
+++ b/xps/xpstile.c
@@ -285,10 +285,10 @@ xps_parse_tiling_brush(xps_context_t *ctx, char *base_uri, xps_resource_t *dict,
xps_parse_rectangle(ctx, viewport_att, &viewport);
/* some sanity checks on the viewport/viewbox size */
- if (fabs(viewport.q.x - viewport.p.x) < 0.01) return 0;
- if (fabs(viewport.q.y - viewport.p.y) < 0.01) return 0;
- if (fabs(viewbox.q.x - viewbox.p.x) < 0.01) return 0;
- if (fabs(viewbox.q.y - viewbox.p.y) < 0.01) return 0;
+ if (fabs(viewport.q.x - viewport.p.x) < 0.01) { gs_warn("skipping tile with zero width view port"); return 0; }
+ if (fabs(viewport.q.y - viewport.p.y) < 0.01) { gs_warn("skipping tile with zero height view port"); return 0; }
+ if (fabs(viewbox.q.x - viewbox.p.x) < 0.01) { gs_warn("skipping tile with zero width view box"); return 0; }
+ if (fabs(viewbox.q.y - viewbox.p.y) < 0.01) { gs_warn("skipping tile with zero height view box"); return 0; }
scalex = (viewport.q.x - viewport.p.x) / (viewbox.q.x - viewbox.p.x);
scaley = (viewport.q.y - viewport.p.y) / (viewbox.q.y - viewbox.p.y);