Spaces:
Running
on
Zero
Running
on
Zero
Bug fix in image composite
Browse files- utils/image_utils.py +4 -0
utils/image_utils.py
CHANGED
|
@@ -491,8 +491,12 @@ def alpha_composite_with_control(base_image, image_with_alpha, alpha_percent=100
|
|
| 491 |
"""
|
| 492 |
name = None
|
| 493 |
directory = None
|
|
|
|
|
|
|
| 494 |
image_with_alpha, isdict = get_image_from_dict(image_with_alpha)
|
| 495 |
alpha_multiplier = alpha_percent / 100.0
|
|
|
|
|
|
|
| 496 |
if isinstance(base_image, str):
|
| 497 |
directory, _, name,_, new_ext = get_file_parts(base_image)
|
| 498 |
base_image = open_image(base_image)
|
|
|
|
| 491 |
"""
|
| 492 |
name = None
|
| 493 |
directory = None
|
| 494 |
+
if image_with_alpha is None:
|
| 495 |
+
return base_image
|
| 496 |
image_with_alpha, isdict = get_image_from_dict(image_with_alpha)
|
| 497 |
alpha_multiplier = alpha_percent / 100.0
|
| 498 |
+
if base_image is None:
|
| 499 |
+
return image_with_alpha
|
| 500 |
if isinstance(base_image, str):
|
| 501 |
directory, _, name,_, new_ext = get_file_parts(base_image)
|
| 502 |
base_image = open_image(base_image)
|