summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-12-08 15:06:07 +0100
committerTor Andersson <tor@ghostscript.com>2004-12-08 15:06:07 +0100
commit5537c50d225b8521a043859f9de4057d271cac97 (patch)
treea3bf8962f522f3e398dcd99eb3452e913127bbce /test
parent576f0af8fbeb49f6e813d06379ed8b0db07ea271 (diff)
downloadmupdf-5537c50d225b8521a043859f9de4057d271cac97.tar.xz
seek/tell for openbuffer. path clip cloned too early.
Diffstat (limited to 'test')
-rw-r--r--test/x11pdf.c31
-rw-r--r--test/ximage.c9
2 files changed, 25 insertions, 15 deletions
diff --git a/test/x11pdf.c b/test/x11pdf.c
index 5dbfb506..6e38071f 100644
--- a/test/x11pdf.c
+++ b/test/x11pdf.c
@@ -48,7 +48,10 @@ static fz_pixmap *image;
void usage()
{
- fprintf(stderr, "usage: x11pdf [-u password] file.pdf\n");
+ fprintf(stderr, "usage: x11pdf [-b] [-pzr page/zoom/rotate] [-u password] file.pdf\n");
+ fprintf(stderr,
+"\n"
+ );
exit(1);
}
@@ -200,7 +203,13 @@ static void pdfopen(char *filename, char *password)
error = pdf_openpdf(&xref, filename);
if (error)
- fz_abort(error);
+ {
+ fz_warn(error->msg);
+ printf("trying to repair...\n");
+ error = pdf_repairpdf(&xref, filename);
+ if (error)
+ fz_abort(error);
+ }
error = pdf_decryptpdf(xref);
if (error)
@@ -486,12 +495,14 @@ int main(int argc, char **argv)
char *filename;
int c;
+ int benchmark = 0;
char *password = "";
- while ((c = getopt(argc, argv, "z:r:p:u:")) != -1)
+ while ((c = getopt(argc, argv, "bz:r:p:u:")) != -1)
{
switch (c)
{
+ case 'b': ++benchmark; break;
case 'u': password = optarg; break;
case 'p': pageno = atoi(optarg); break;
case 'z': zoom = atof(optarg); break;
@@ -512,13 +523,16 @@ int main(int argc, char **argv)
pdfopen(filename, password);
showpage();
-#ifdef RUNFAST
- while (pageno < count)
+ if (benchmark)
{
- pageno ++;
- showpage();
+ while (pageno < count)
+ {
+ pageno ++;
+ showpage();
+ }
+ return 0;
}
-#else
+
while (1)
{
int len;
@@ -548,7 +562,6 @@ int main(int argc, char **argv)
break;
}
}
-#endif
pdf_closepdf(xref);
diff --git a/test/ximage.c b/test/ximage.c
index 1e56fa2e..9f7ec064 100644
--- a/test/ximage.c
+++ b/test/ximage.c
@@ -125,9 +125,6 @@ createximage(Display *dpy, Visual *vis, XShmSegmentInfo *xsi, int depth, int w,
shmctl(xsi->shmid, IPC_RMID, 0);
- printf("make xshm w=%d h=%d id=%d data=%p\n",
- w, h, xsi->shmid, xsi->shmaddr);
-
return img;
fallback:
@@ -211,7 +208,7 @@ select_mode(void)
gs = ffs(gm) - 1;
bs = ffs(bm) - 1;
- printf("mode %d/%d %08lx %08lx %08lx (%ld,%ld,%ld) %s%s\n",
+ printf("ximage: mode %d/%d %08lx %08lx %08lx (%ld,%ld,%ld) %s%s\n",
info.visual.depth,
info.bitsperpixel,
rm, gm, bm, rs, gs, bs,
@@ -246,7 +243,7 @@ select_mode(void)
info.mode = byteorder == MSBFirst ? RGBA8888 : ABGR8888;
}
- printf("convert ARGB8888 to %s\n", modename[info.mode]);
+ printf("ximage: ARGB8888 to %s\n", modename[info.mode]);
/* select conversion function */
info.convert_func = ximage_convert_funcs[info.mode];
@@ -340,7 +337,7 @@ ximage_init(Display *display, int screen, Visual *visual)
if (!ok)
return 0;
- printf("Using %sPutImage\n", info.useshm ? "XShm" : "X");
+ printf("ximage: %sPutImage\n", info.useshm ? "XShm" : "X");
return 1;
}