From 54d3ad974373622eb658361c51f5271db80498e2 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 27 Apr 2024 12:37:42 +0530 Subject: [PATCH] [mob][photos] Remove unnecessary optional parameter --- mobile/lib/utils/face/face_util.dart | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/mobile/lib/utils/face/face_util.dart b/mobile/lib/utils/face/face_util.dart index b417657915..389336115f 100644 --- a/mobile/lib/utils/face/face_util.dart +++ b/mobile/lib/utils/face/face_util.dart @@ -14,14 +14,11 @@ const _faceImageBufferFactor = 0.2; ///Convert img.Image to ui.Image and use RawImage to display. Future> generateImgFaceThumbnails( String imagePath, - List faceBoxes, { - ///Pass decodedImage decoded by [decodeToImgImage] to avoid decoding image - ///multiple times if all faces are from the same image (eg: File info). - img.Image? decodedImage, -}) async { + List faceBoxes, +) async { final faceThumbnails = []; - final image = decodedImage ?? await decodeToImgImage(imagePath); + final image = await decodeToImgImage(imagePath); for (FaceBox faceBox in faceBoxes) { final croppedImage = cropFaceBoxFromImage(image, faceBox); @@ -33,12 +30,9 @@ Future> generateImgFaceThumbnails( Future> generateJpgFaceThumbnails( String imagePath, - List faceBoxes, { - ///Pass decodedImage decoded by [decodeToImgImage] to avoid decoding image - ///multiple times if all faces are from the same image (eg: File info). - img.Image? decodedImage, -}) async { - final image = decodedImage ?? await decodeToImgImage(imagePath); + List faceBoxes, +) async { + final image = await decodeToImgImage(imagePath); final croppedImages = []; for (FaceBox faceBox in faceBoxes) { final croppedImage = cropFaceBoxFromImage(image, faceBox);