--- ray/src/px/ximage.c 1989/07/24 10:45:12 1.8 +++ ray/src/px/ximage.c 1989/09/13 15:41:52 1.10 @@ -141,15 +141,13 @@ char *argv[]; /* 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) { - ourview.hresolu = xmax; - ourview.vresolu = ymax; + if (gotview) if (setview(&ourview) != NULL) gotview = 0; - } + if ((scanline = (COLR *)malloc(xmax*sizeof(COLR))) == NULL) quiterr("out of memory");