diff -ur xdvik-22.82.orig/texk/xdvik/image-magick.c xdvik-22.82/texk/xdvik/image-magick.c
--- xdvik-22.82.orig/texk/xdvik/image-magick.c	2004-04-18 20:21:09.000000000 +0800
+++ xdvik-22.82/texk/xdvik/image-magick.c	2004-04-22 15:20:29.000000000 +0800
@@ -60,6 +60,10 @@
 
 #ifdef MAGICK	/* entire file */
 
+#ifndef MAGICK_RENDER_PS
+#  define MAGICK_RENDER_PS 0
+#endif
+
 #include "magick/api.h"
 #if MAGICK_VER_MAJOR > 5 || MAGICK_VER_MINOR >= 4
 #  include "magick/xwindow.h"	/* IM >= 5.4 */
@@ -867,7 +871,7 @@
 #if 0
     XPutImage(DISP, mane.win, globals.gc.copy, img->ximage, 0, 0,
 	      xul, yul - img->ximage.height + 1,
-	      img->ximage.width, img->ximage.height);
+	      img->ximage->width, img->ximage->height);
 #else
     /* Try to make background pixels transparent */
     {
@@ -1047,6 +1051,31 @@
     }
 }
 
+#if !MAGICK_RENDER_PS
+static Boolean
+is_ps(char *fn)
+{
+    int l;
+    char *p;
+    
+    if (strchr(fn, '`') != NULL)
+	return False;
+
+    l = strlen(fn);
+    p = fn + l - 1;
+    while (p > fn && *p != '.' && *p != '/')
+	p--;
+    l -= p - fn;
+    if (*p == '.' && ((l >= 3 && !memicmp(p, ".ps", 3)) ||
+		      (l >= 4 && !memicmp(p, ".eps", 4)))) {
+	if (globals.debug & DBG_PS)
+	    fprintf(stderr, "Magick: passing PS/EPS file to psgs.c\n");
+	return True;
+    }
+    return False;
+}
+#endif
+
 /* Process EPSF specials */
 
 static Boolean
@@ -1118,6 +1147,11 @@
 	fprintf(stderr, "Magick: epsf_special: filename = '%s'\n",
 			info.filename);
 
+#if !MAGICK_RENDER_PS
+    if (is_ps(info.filename))
+	return False;
+#endif
+
     /* Scan for EPSF keywords */
     while (*cp != '\0') {
 	while (isspace((int)*cp))
@@ -1336,6 +1370,15 @@
     }
     memcpy(info.filename, cp, p - cp); /* no need to terminate because of memset(...) above */
 
+    if (globals.debug & DBG_PS)
+	fprintf(stderr, "Magick: emgraph_special: filename = '%s'\n",
+			info.filename);
+
+#if !MAGICK_RENDER_PS
+    if (is_ps(info.filename))
+	return False;
+#endif
+
     cp = p;
 
     /* get width */
