mirror of
https://github.com/status-im/status-python-sdk.git
synced 2026-08-30 21:51:14 +00:00
bug: Center Profile Picture
- Related to https://github.com/status-im/status-python-sdk/issues/27
This commit is contained in:
@@ -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!")
|
||||
|
||||
Reference in New Issue
Block a user