Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Commit 3a9bc79

Browse files
committed
chore(autoLevel): fix variable name
1 parent 9f87a41 commit 3a9bc79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/filters/autoLevel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ export function autoLevel(image: Image, options: AutoLevelOptions = {}): Image {
3131
let max: number | number[] = minMax.max;
3232

3333
if (uniform) {
34-
let minDiffIndex = -1;
34+
let maxDiffIndex = -1;
3535
let previousDiff = -1;
3636
for (let i = 0; i < minMax.max.length; i++) {
3737
const difference = minMax.max[i] - minMax.min[i];
3838
if (difference > previousDiff) {
39-
minDiffIndex = i;
39+
maxDiffIndex = i;
4040
previousDiff = difference;
4141
}
4242
}
43-
min = minMax.min[minDiffIndex];
44-
max = minMax.max[minDiffIndex];
43+
min = minMax.min[maxDiffIndex];
44+
max = minMax.max[maxDiffIndex];
4545
}
4646

4747
let channels: number[] = new Array(image.components)

0 commit comments

Comments
 (0)