mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-23 23:30:34 +03:00
truncate zero coefficients
This commit is contained in:
parent
62388199fa
commit
7d3db1f02a
|
@ -176,6 +176,16 @@ ImagingPrecompute(int inSize, int outSize, struct filter *filterp,
|
||||||
k = &kk[xx * kmax];
|
k = &kk[xx * kmax];
|
||||||
for (x = 0; x < xmax; x++) {
|
for (x = 0; x < xmax; x++) {
|
||||||
double w = filterp->filter((x + xmin - center + 0.5) * ss);
|
double w = filterp->filter((x + xmin - center + 0.5) * ss);
|
||||||
|
if (w == 0) {
|
||||||
|
if (x == 0) {
|
||||||
|
x -= 1;
|
||||||
|
xmin += 1;
|
||||||
|
xmax -= 1;
|
||||||
|
} else if (x == xmax - 1) {
|
||||||
|
xmax -= 1;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
k[x] = w;
|
k[x] = w;
|
||||||
ww += w;
|
ww += w;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user