Skip to content

Commit

Permalink
fix(test): Fix test rendering not using the correct fullart image, fi…
Browse files Browse the repository at this point in the history
…xed image testing for Split template
  • Loading branch information
Investigamer committed Jul 7, 2023
1 parent 93df414 commit 050c100
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
10 changes: 3 additions & 7 deletions src/templates/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,9 @@ def load_artwork(self) -> None:
"""
Loads the specified art file into the specified layer.
"""
# Choose image for dev_mode
if cfg.test_mode:
# Check for Fullart test image
dims = psd.get_layer_dimensions(self.art_reference)
if (dims['width'] * 1.2) < dims['height']:
# Use fullart test image
self.layout.filename = osp.join(con.path_img, "test-fa.png")
# Check for fullart test image
if cfg.test_mode and self.is_fullart:
self.layout.filename = osp.join(con.path_img, "test-fa.png")

# Paste the file into the art
self.active_layer = self.art_layer
Expand Down
16 changes: 9 additions & 7 deletions src/templates/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,12 @@ def create_blended_layer(

def load_artwork(self) -> None:

# Check for fullart test image
if cfg.test_mode and self.is_fullart:
self.layout.filename = [osp.join(con.path_img, "test-fa.png")] * 2
else:
self.layout.filename = [self.layout.filename] * 2

# Manually select a second artwork if not provided
self.layout: SplitLayout = self.layout
if len(self.layout.filename) == 1:
Expand All @@ -279,13 +285,9 @@ def load_artwork(self) -> None:
# Load art for each side
for i, ref in enumerate(self.art_reference):

# Choose image for dev_mode
if cfg.test_mode:
# Check for Fullart test image
dims = psd.get_layer_dimensions(ref)
if (dims['width'] * 1.2) < dims['height']:
# Use fullart test image
self.layout.filename = osp.join(con.path_img, "test-fa.png")
# Check for fullart test image
if cfg.test_mode and self.is_fullart:
self.layout.filename = [osp.join(con.path_img, "test-fa.png")] * 2

# Paste the file into the art
self.active_layer = self.art_layer[i]
Expand Down

0 comments on commit 050c100

Please sign in to comment.