From 3fad0195312f60d9da2d80a8088924575a374020 Mon Sep 17 00:00:00 2001 From: Nick Ninov Date: Tue, 11 Aug 2026 09:37:53 +0300 Subject: [PATCH] bug: Center Profile Picture - Related to https://github.com/status-im/status-python-sdk/issues/27 --- status_sdk/account.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/status_sdk/account.py b/status_sdk/account.py index 6275845..e75fc5d 100644 --- a/status_sdk/account.py +++ b/status_sdk/account.py @@ -416,13 +416,13 @@ class Account: self.logger.info("File is already in asset path") img = Image.open(asset_file_path) - params = [ - self.info["key_uid"], - docker_file_path, - 0, - 0, - *img.size - ] + width, height = img.size + side = min(width, height) + ax = (width - side) // 2 # left edge, centered horizontally + ay = (height - side) // 2 # top edge, centered vertically + bx = ax + side # right edge + by = ay + side # bottom edg + params = [self.info["key_uid"], docker_file_path, ax, ay, bx, by] self.logger.info(f"Setting {file_path} as profile picture") self._call_rpc("identity", "storeIdentityImage", params) self.logger.info(f"Profile picture has been updated!")