Skip to content

Commit 2d436a6

Browse files
authored
Update postergeist.py
Fix: Hide overlay when poster fills canvas The overlay was previously being displayed on all images, including those that filled the entire vertical space of the canvas. This was not the intended behavior as it could obscure the poster. This commit modifies the `prepare_image_frame` method to add a conditional check. The overlay is now only rendered if the poster's height is less than the canvas's height, ensuring it only appears when there is empty, letterboxed space at the bottom.
1 parent 6dba612 commit 2d436a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postergeist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def prepare_image_frame(self, img_to_process):
9898
poster_y = 0
9999
background.paste(poster, (poster_x, poster_y))
100100

101-
if self.overlays:
101+
if self.overlays and poster.height < canvas_h:
102102
overlay_path = random.choice(self.overlays)
103103
try:
104104
with Image.open(overlay_path) as overlay_img:

0 commit comments

Comments
 (0)