Skip to content

Commit 33cf860

Browse files
committed
support crop center point
1 parent 3cac5e3 commit 33cf860

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/bma_client_lib/bma_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _handle_image_conversion_job(
156156

157157
logger.debug(f"Desired image size is {size}, aspect ratio: {ratio} ({orig_str}), converting image...")
158158
start = time.time()
159-
job.images = transform_image(original_img=image, crop_w=size[0], crop_h=size[1])
159+
job.images = transform_image(original_img=image, crop_w=size[0], crop_h=size[1], center_point=crop_center)
160160
logger.debug(f"Result image size is {job.images[0].width}*{job.images[0].height}")
161161
logger.debug(f"Converting image size and AR took {time.time() - start} seconds")
162162
logger.debug("Done.")

src/bma_client_lib/datastructures.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class ImageConversionJob(BaseImageResultJob):
5151
height: int
5252
mimetype: str
5353
custom_aspect_ratio: bool
54+
crop_center_x: int
55+
crop_center_y: int
5456

5557

5658
@dataclass(kw_only=True)

0 commit comments

Comments
 (0)