[24] fix addon images

pull/1024/head
meisnate12 2 years ago
parent 7f9f963cba
commit be36bbba36

@ -1 +1 @@
1.17.3-develop23
1.17.3-develop24

@ -95,7 +95,6 @@ There are many attributes available when using overlays to edit how they work.
| `back_radius` | Backdrop Radius for the Text Overlay.<br>**Value:** Integer greater than 0 | &#10060; |
| `back_line_color` | Backdrop Line Color for the Text Overlay.<br>**Value:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA`. | &#10060; |
| `back_line_width` | Backdrop Line Width for the Text Overlay.<br>**Value:** Integer greater than 0 | &#10060; |
| `special_text` | Text Format for Special Text Overlays.<br>**`special_text` Only works with text overlays** | &#10060; |
| `addon_offset` | Text Addon Image Offset from the text.<br>**`addon_offset` Only works with text overlays**<br>**Value:** Integer 0 or greater | &#10060; |
| `addon_position` | Text Addon Image Alignment in relation to the text.<br>**`addon_position` Only works with text overlays**<br>**Values:** `left`, `right`, `top`, `bottom` | &#10060; |

@ -796,11 +796,11 @@ class ConfigFile:
for file in util.get_list(lib["overlay_path"], split=False):
if isinstance(file, dict):
if ("remove_overlays" in file and file["remove_overlays"] is True) \
or ("remove_overlay" in file and file["remove_overlay"] is True) \
or ("revert_overlays" in file and file["revert_overlays"] is True):
or ("remove_overlay" in file and file["remove_overlay"] is True) \
or ("revert_overlays" in file and file["revert_overlays"] is True):
params["remove_overlays"] = True
if ("reapply_overlays" in file and file["reapply_overlays"] is True) \
or ("reapply_overlay" in file and file["reapply_overlay"] is True):
or ("reapply_overlay" in file and file["reapply_overlay"] is True):
params["reapply_overlays"] = True
if "reset_overlays" in file or "reset_overlay" in file:
attr = f"reset_overlay{'s' if 'reset_overlays' in file else ''}"

@ -187,7 +187,7 @@ class Overlay:
self.back_box = None
back_width = util.parse("Overlay", "back_width", self.data["back_width"], datatype="int", parent="overlay", minimum=0) if "back_width" in self.data else -1
back_height = util.parse("Overlay", "back_height", self.data["back_height"], datatype="int", parent="overlay", minimum=0) if "back_height" in self.data else -1
if (back_width >= 0 and back_height < 0) or (back_height >= 0 and back_width < 0):
if (back_width >= 0 > back_height) or (back_height >= 0 > back_width):
raise Failed(f"Overlay Error: overlay attributes back_width and back_height must be used together")
if self.back_align != "center" and (back_width < 0 or back_height < 0):
raise Failed(f"Overlay Error: overlay attribute back_align only works when back_width and back_height are used")
@ -286,8 +286,8 @@ class Overlay:
self.font_color = ImageColor.getcolor(self.data["font_color"], "RGBA")
except ValueError:
raise Failed(f"Overlay Error: overlay font_color: {self.data['font_color']} invalid")
if "stroke_size" in self.data:
self.stroke_size = util.parse("Overlay", "stroke_size", self.data["stroke_size"], datatype="int", parent="overlay", default=self.stroke_size)
if "stroke_width" in self.data:
self.stroke_width = util.parse("Overlay", "stroke_width", self.data["stroke_width"], datatype="int", parent="overlay", default=self.stroke_width)
if "stroke_color" in self.data and self.data["stroke_color"]:
try:
self.stroke_color = ImageColor.getcolor(self.data["stroke_color"], "RGBA")
@ -307,10 +307,9 @@ class Overlay:
datetime.now().strftime(match.group(1))
except ValueError:
raise Failed("Overlay Error: originally_available date format not valid")
else:
box = self.image.size if self.image else None
self.portrait, self.portrait_box = self.get_backdrop(portrait_dim, box=box, text=self.name[5:-1])
self.landscape, self.landscape_box = self.get_backdrop(landscape_dim, box=box, text=self.name[5:-1])
box = self.image.size if self.image else None
self.portrait, self.portrait_box = self.get_backdrop(portrait_dim, box=box, text=self.name[5:-1])
self.landscape, self.landscape_box = self.get_backdrop(landscape_dim, box=box, text=self.name[5:-1])
else:
if not self.path:
clean_name, _ = util.validate_filename(self.name)

@ -295,11 +295,12 @@ class Overlays:
logger.warning(e)
continue
new_poster.paste(overlay_image, (0, 0), overlay_image)
if current_overlay.image:
new_poster.paste(current_overlay.image, addon_box, current_overlay.image)
else:
overlay_image = current_overlay.landscape if isinstance(item, Episode) else current_overlay.portrait
addon_box = current_overlay.landscape_box if isinstance(item, Episode) else current_overlay.portrait_box
new_poster.paste(overlay_image, (0, 0), overlay_image)
if current_overlay.image:
new_poster.paste(current_overlay.image, addon_box, current_overlay.image)
else:
if current_overlay.has_coordinates():
if current_overlay.portrait is not None:

Loading…
Cancel
Save