Skip to content

Commit

Permalink
Merge pull request #649 from yegor-pelykh/main
Browse files Browse the repository at this point in the history
Fixed quantizer selection conditions
  • Loading branch information
brendan-duncan authored May 12, 2024
2 parents ff549a0 + 0bca428 commit 0d9921e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/src/filter/quantize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Image quantize(Image src,

if (method == QuantizeMethod.octree || numberOfColors < 4) {
quantizer = OctreeQuantizer(src, numberOfColors: numberOfColors);
} else if (method == QuantizeMethod.octree) {
} else if (method == QuantizeMethod.neuralNet) {
quantizer = NeuralQuantizer(src, numberOfColors: numberOfColors);
} else {
quantizer = BinaryQuantizer();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/formats/gif_encoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class GifEncoder extends Encoder {
numberOfColors: numColors, samplingFactor: samplingFactor);
} else if (quantizerType == QuantizerType.octree) {
_lastColorMap = OctreeQuantizer(image, numberOfColors: numColors);
} else if (quantizerType == QuantizerType.binary) {
} else {
_lastColorMap = BinaryQuantizer();
}

Expand Down Expand Up @@ -76,7 +76,7 @@ class GifEncoder extends Encoder {
numberOfColors: numColors, samplingFactor: samplingFactor);
} else if (quantizerType == QuantizerType.octree) {
_lastColorMap = OctreeQuantizer(image, numberOfColors: numColors);
} else if (quantizerType == QuantizerType.binary) {
} else {
_lastColorMap = BinaryQuantizer();
}

Expand Down

0 comments on commit 0d9921e

Please sign in to comment.