Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Fix regression I created

laurenspriem23eaab0757ee
diff --git a/mobile/lib/utils/image_ml_util.dart b/mobile/lib/utils/image_ml_util.dart
index 165fbff0ca..e469e6970f 100644
--- a/mobile/lib/utils/image_ml_util.dart
+++ b/mobile/lib/utils/image_ml_util.dart
@@ -343,13 +343,15 @@ RGB _readPixelColor(
Image image,
Uint8List rgbaBytes,
) {
- if (y < -maxKernelRadius ||
- y >= image.height + maxKernelRadius ||
- x < -maxKernelRadius ||
- x >= image.width + maxKernelRadius) {
- _logger.severe(
- '`readPixelColor`: Invalid pixel coordinates, out of bounds. x: $x, y: $y',
- );
+ if (y < 0 || y >= image.height || x < 0 || x >= image.width) {
+ if (y < -maxKernelRadius ||
+ y >= image.height + maxKernelRadius ||
+ x < -maxKernelRadius ||
+ x >= image.width + maxKernelRadius) {
+ _logger.severe(
+ '`readPixelColor`: Invalid pixel coordinates, out of bounds. x: $x, y: $y',
+ );
+ }
return const (114, 114, 114);
}