From 107b79eae652c520921bbdf335d206b6e30ab3a2 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:19:51 +0530 Subject: [PATCH] [mob] Reduce invalid pixel noise --- mobile/lib/utils/image_ml_util.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile/lib/utils/image_ml_util.dart b/mobile/lib/utils/image_ml_util.dart index 0705237ba4..ab29eb9192 100644 --- a/mobile/lib/utils/image_ml_util.dart +++ b/mobile/lib/utils/image_ml_util.dart @@ -36,7 +36,9 @@ Color readPixelColor( ) { if (x < 0 || x >= image.width || y < 0 || y >= image.height) { // throw ArgumentError('Invalid pixel coordinates.'); - log('[WARNING] `readPixelColor`: Invalid pixel coordinates, out of bounds'); + if (y != -1) { + log('[WARNING] `readPixelColor`: Invalid pixel coordinates, out of bounds'); + } return const Color.fromARGB(0, 0, 0, 0); } assert(byteData.lengthInBytes == 4 * image.width * image.height);