97 |
|
if (ncp->hdrflags & HF_RESOUT) /* put resolution string? */ |
98 |
|
fputsresolu(&ncp->res, stdout); |
99 |
|
|
100 |
< |
ncp->dstart = ncp->curpos = ftell(ncp->finp); |
100 |
> |
ncp->dstart = ftell(ncp->finp); |
101 |
|
return 1; |
102 |
|
} |
103 |
|
|
137 |
|
if (c == EOF && feof(ncp->finp)) |
138 |
|
return -1; |
139 |
|
|
140 |
– |
ncp->curpos += 4; |
141 |
– |
|
140 |
|
if (c == lastc) { /* optimization */ |
141 |
|
VCOPY(nrm, lastv); |
142 |
|
} else { |
154 |
|
int |
155 |
|
seek_nc_pix(NORMCODEC *ncp, int x, int y) |
156 |
|
{ |
159 |
– |
long seekpos; |
160 |
– |
|
157 |
|
if ((ncp->res.xr <= 0) | (ncp->res.yr <= 0)) { |
158 |
|
if (ncp->hdrflags & HF_STDERR) { |
159 |
|
fputs(progname, stderr); |
169 |
|
} |
170 |
|
return 0; |
171 |
|
} |
172 |
< |
seekpos = ncp->dstart + 4*((long)y*scanlen(&ncp->res) + x); |
173 |
< |
|
178 |
< |
if (seekpos != ncp->curpos && |
179 |
< |
fseek(ncp->finp, seekpos, SEEK_SET) == EOF) { |
172 |
> |
if (fseek(ncp->finp, ncp->dstart + 4*((long)y*scanlen(&ncp->res) + x), |
173 |
> |
SEEK_SET) == EOF) { |
174 |
|
if (ncp->hdrflags & HF_STDERR) { |
175 |
|
fputs(ncp->inpname, stderr); |
176 |
|
fputs(": seek error\n", stderr); |
177 |
|
} |
178 |
|
return -1; |
179 |
|
} |
186 |
– |
ncp->curpos = seekpos; |
180 |
|
return 1; |
181 |
|
} |
182 |
|
|