fix(images): java.lang.IllegalArgumentException: x must be < bitmap.width() in images.findMultiColors()
This commit is contained in:
@@ -110,7 +110,12 @@ public class ColorFinder {
|
||||
int y = points[i + 1];
|
||||
int color = points[i + 2];
|
||||
ColorDetector colorDetector = new ColorDetector.DifferenceDetector(color, threshold);
|
||||
int c = image.pixel((int) (x + startingPoint.x), (int) (y + startingPoint.y));
|
||||
x += startingPoint.x;
|
||||
y += startingPoint.y;
|
||||
if (x >= image.getWidth() || y >= image.getHeight()) {
|
||||
return false;
|
||||
}
|
||||
int c = image.pixel(x, y);
|
||||
if (!colorDetector.detectsColor(Color.red(c), Color.green(c), Color.blue(c))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user