--- ray/src/px/ximage.c 1989/04/21 08:44:05 1.5 +++ ray/src/px/ximage.c 1989/09/12 13:04:42 1.9 @@ -137,13 +137,11 @@ char *argv[]; sprintf(errmsg, "can't open file \"%s\"", fname); quiterr(errmsg); } - } else - goto userr; - + } /* get header */ getheader(fin, headline); /* get picture dimensions */ - if (fscanf(fin, "-Y %d +X %d\n", &ymax, &xmax) != 2) + if (fgetresolu(&xmax, &ymax, fin) != (YMAJOR|YDECR)) quiterr("bad picture size"); /* set view parameters */ if (gotview) { @@ -347,7 +345,7 @@ redraw(x, y, w, h) /* redraw section of window */ int x, y; int w, h; { - if (map_rcolors(ourras) == NULL) { + if (ourras->ncolors && map_rcolors(ourras) == NULL) { fprintf(stderr, "%s: cannot allocate colors\n", progname); return(-1); } @@ -431,6 +429,7 @@ XKeyEvent *ekey; getras(); /* fall through */ case CTRL(R): /* redraw */ + case CTRL(L): XClear(wind); return(redraw(0, 0, width, height)); case ' ': /* clear */ @@ -690,7 +689,7 @@ pixel *l; } -picreadcm(map) /* do gamcor correction */ +picreadcm(map) /* do gamma correction */ colormap map; { extern double pow();