Index: kit/CHANGELOG
diff -u kit/CHANGELOG:1.9 kit/CHANGELOG:removed
--- kit/CHANGELOG:1.9 Sat Sep 5 00:11:21 1998
+++ kit/CHANGELOG Mon Nov 8 05:10:03 1999
@@ -1,51 +0,0 @@
-CHANGELOG for magicpoint
-$Id: CHANGELOG,v 1.9 1998/09/04 15:11:21 onoe Exp $
-
-Fri Sep 5 1998 onoe@sm.sony.co.jp
- * handle key inputs from invoked terminal as pressed on Xserver,
- even if the Xserver is running on a remote host.
-
-Mon Aug 26 1998 itojun@iijlab.net
- * new copyright. (BSDish copyright without clause 3)
-
-Mon Aug 25 1998 itojun@iijlab.net
- * print.c: better x11/freetype/vflib -> postscript font mapping.
-
-Mon Aug 23 1998 kato@wide.ad.jp
- * embedded image support (added mgpembed.pl and embed.c)
-
-Mon Aug 22 1998 itojun@iijlab.net
- * added contrib/xmindpath, MindPath PocketPoint user-level driver.
-
-Fri Jul 10 11:57:59 JST 1998 itojun@iijlab.net
- * cache gs-generated image file.
- Suggested by: luigi@FreeBSD.org
-
-Mon Jul 6 11:38:32 JST 1998 itojun@iijlab.net
- * capable of handling GB2312 and KSC5601 encoding.
- they must be encoded by using iso-2022 like escape sequences.
- EUC-cn or EUC-kr does not work.
- * -x option is added.
-
-Thu Jul 2 18:04:16 JST 1998 itojun@iijlab.net
- * eliminate gsview.
- * revamp "xfont" directive. (see SYNTAX for detail)
-
-Thu Jun 25 13:10:28 JST 1998 itojun@iijlab.net
- * print.c: color postscript support by "mgp2ps -c".
-
-changes between 1.02a and 1.03a:
- * To allow color name that has space inbetween ("dark blue"),
- color name after directives SHOULD come with doublequote.
- Therefore,
- %fore blue
- should be
- %fore "blue"
- At this moment, doublequote can be ommitted for backward
- compatibility. We may require to have doublequote in the future.
- Font names and other string parameter obeys the same rule.
- * %image is now capable of rendering encapsulated postscript files
- (*.eps).
- %image foo.eps
- should work fine.
- By using -X option, you can specify device name for ghostscript.
Index: kit/ctlwords.pl
diff -u kit/ctlwords.pl:1.2 kit/ctlwords.pl:removed
--- kit/ctlwords.pl:1.2 Sat Sep 5 06:05:08 1998
+++ kit/ctlwords.pl Mon Nov 8 05:10:04 1999
@@ -1,12 +0,0 @@
-#! /usr/bin/perl
-$counter = 0; # 0 origin
-print "/* generated by ctlwords.awk. do not edit by hand. */\n";
-
-while (<>) {
- next if (!/^\/\*CTL\*\//);
- next if ($_ !~ /(CTL_[A-Z0-9]+)/);
-
- $word = $1;
- print "#define $word\t$counter\n";
- $counter++;
-}
Index: kit/draw.c
diff -u kit/draw.c:1.157 kit/draw.c:1.158
--- kit/draw.c:1.157 Fri Sep 10 16:13:51 1999
+++ kit/draw.c Sun Nov 7 02:28:42 1999
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
/*
- * $Id: draw.c,v 1.157 1999/09/10 07:13:51 itojun Exp $
+ * $Id: draw.c,v 1.158 1999/11/06 17:28:42 nishida Exp $
*/
#include "mgp.h"
@@ -2709,6 +2709,8 @@
} else
yzoomrate = 100;
#else
+ if (!ximagesize) ximagesize = 100;
+ if (!yimagesize) yimagesize = 100;
xzoomrate = ximagesize;
yzoomrate = yimagesize;
image_zoomratio(state, &xzoomrate, &yzoomrate, zoomflag, width, height);
Index: kit/mgp.c
diff -u kit/mgp.c:1.106 kit/mgp.c:1.107
--- kit/mgp.c:1.106 Fri Sep 10 16:13:46 1999
+++ kit/mgp.c Sun Nov 7 02:14:55 1999
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
/*
- * $Id: mgp.c,v 1.106 1999/09/10 07:13:46 itojun Exp $
+ * $Id: mgp.c,v 1.107 1999/11/06 17:14:55 itojun Exp $
*/
static char *mgp_version = "1.06a (990728)";
@@ -87,6 +87,7 @@
static char *dumpdir = NULL;
char *gsdevice = DEFAULT_GSDEV;
+char *htmlimage;
static time_t srctimestamp;
@@ -215,7 +216,7 @@
mgpwdir = p;
}
-#define ACCEPTOPTS "BdvVob:c:eg:f:hlGp:qt:Q:PST:D:CORw:X:x:nF:"
+#define ACCEPTOPTS "BdvVob:c:eg:f:hlGp:qt:Q:PST:D:CORw:X:x:nF:E:"
while ((opt = getopt(argc, argv, ACCEPTOPTS)) != -1) {
#undef ACCEPTOPTS
switch (opt) {
@@ -352,6 +353,10 @@
cache_value = atoi(p2);
break;
+ case 'E':
+ htmlimage = optarg;
+ break;
+
case 'h':
default:
mgp_usage(progname);
@@ -434,6 +439,22 @@
FILE *txt;
int page;
char *childdebug;
+ char convdb[][3][16] = {{ "jpg", "cjpeg", "djpeg" },
+ { "png", "pnmtopng", "pngtopnm" },
+ { NULL, NULL, NULL }};
+ int inum = 0;
+
+ /* check image type */
+ if (htmlimage) {
+ for (inum = 0; *convdb[inum] != NULL; inum++) {
+ if (strcmp(*convdb[inum], htmlimage) == 0)
+ break;
+ }
+ if (*convdb[inum] == NULL) {
+ fprintf(stderr, "unknwon image type %s.\n", htmlimage);
+ cleanup(-1);
+ }
+ }
/* check if we can write to the directory */
sprintf(buf, "%s/%ld", dumpdir, (long)time((time_t *)NULL));
@@ -455,19 +476,22 @@
state_goto(&state, page, 0);
draw_page(&state, NULL);
+
+#define EXT convdb[inum][0]
+
/*
- * dump out jpg image
+ * dump out image
*/
fprintf(stderr, "(full image)");
sprintf(buf, "xwintoppm -silent -name MagicPoint | "
- "cjpeg %s > %s/mgp%05d.jpg",
- childdebug, dumpdir, page);
+ "%s %s > %s/mgp%05d.%s",
+ convdb[inum][1], childdebug, dumpdir, page, EXT);
system(buf); /*XXX security hole*/
fprintf(stderr, "(thumbnail)");
- sprintf(buf, "djpeg %s/mgp%05d.jpg | "
- "pnmscale 0.25 | cjpeg %s > %s/mgp%05d.idx.jpg",
- dumpdir, page, childdebug,
- dumpdir, page);
+ sprintf(buf, "%s %s/mgp%05d.%s | "
+ "pnmscale 0.25 | %s %s > %s/mgp%05d.idx.%s",
+ convdb[inum][2], dumpdir, page, EXT, convdb[inum][1], childdebug,
+ dumpdir, page, EXT);
system(buf); /*XXX security hole*/
/*
@@ -502,13 +526,13 @@
fprintf(html, "
Page %d: %s
\n", page, page_title(page));
fprintf(html, "