Skip to content

armgit / ente

Public Imported from GitHub
0

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

Log higher image resolutions and store empty result

laurenspriembcb389c56d1a
diff --git a/mobile/apps/photos/lib/utils/image_ml_util.dart b/mobile/apps/photos/lib/utils/image_ml_util.dart
index ffecd69db5..7d7ea1d0c8 100644
--- a/mobile/apps/photos/lib/utils/image_ml_util.dart
+++ b/mobile/apps/photos/lib/utils/image_ml_util.dart
@@ -70,6 +70,12 @@ Future<DecodedImage> decodeImageFromPath(
);
final image = await decodeImageFromData(convertedData!);
_logger.info('Conversion successful, jpeg decoded');
+ if (image.width >= 20000 || image.height >= 20000) {
+ // Failing and storing empty result when the image dimensions are higher than max compression limits
+ _logger
+ .severe('Image res too high, W:${image.width} H:${image.height}');
+ throw Exception('Res too high W:${image.width} H:${image.height}');
+ }
if (!includeRgbaBytes) {
return DecodedImage(image);
}