50 |
|
/* add new header info. */ |
51 |
|
printf("%s\n\n", progname); |
52 |
|
/* get picture size */ |
53 |
< |
if (fgets(buf, sizeof(buf), fin) == NULL || |
54 |
< |
sscanf(buf, "-Y %d +X %d\n", &yres, &xres) != 2) { |
53 |
> |
if (fgetresolu(&xres, &yres, fin) != (YMAJOR|YDECR)) { |
54 |
|
fprintf(stderr, "%s: bad picture size\n", progname); |
55 |
|
exit(1); |
56 |
|
} |
57 |
|
/* write new picture size */ |
58 |
< |
printf("-Y %d +X %d\n", xres, yres); |
58 |
> |
fputresolu(YMAJOR|YDECR, yres, xres, stdout); |
59 |
|
/* compute buffer capacity */ |
60 |
|
nrows = sizeof(buf)/sizeof(COLR)/yres; |
61 |
|
rotate(fin); /* rotate the image */ |
86 |
|
exit(1); |
87 |
|
} |
88 |
|
for (inx = 0; inx < nrows && xoff+inx < xres; inx++) |
89 |
< |
bcopy(inline[xoff+inx], scanbar[inx*yres+iny], |
89 |
> |
bcopy((char *)inline[xoff+inx], |
90 |
> |
(char *)scanbar[inx*yres+iny], |
91 |
|
sizeof(COLR)); |
92 |
|
} |
93 |
|
for (inx = 0; inx < nrows && xoff+inx < xres; inx++) |