--- ray/src/px/protate.c 1989/02/02 10:49:27 1.1 +++ ray/src/px/protate.c 1989/09/12 13:04:27 1.2 @@ -50,13 +50,12 @@ char *argv[]; /* add new header info. */ printf("%s\n\n", progname); /* get picture size */ - if (fgets(buf, sizeof(buf), fin) == NULL || - sscanf(buf, "-Y %d +X %d\n", &yres, &xres) != 2) { + if (fgetresolu(&xres, &yres, fin) != (YMAJOR|YDECR)) { fprintf(stderr, "%s: bad picture size\n", progname); exit(1); } /* write new picture size */ - printf("-Y %d +X %d\n", xres, yres); + fputresolu(YMAJOR|YDECR, yres, xres, stdout); /* compute buffer capacity */ nrows = sizeof(buf)/sizeof(COLR)/yres; rotate(fin); /* rotate the image */