diff --git a/VERSION b/VERSION index e3f4caae..2b413951 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.3-develop23 +1.17.3-develop24 diff --git a/docs/metadata/overlay.md b/docs/metadata/overlay.md index f69386db..ae211595 100644 --- a/docs/metadata/overlay.md +++ b/docs/metadata/overlay.md @@ -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.
**Value:** Integer greater than 0 | ❌ | | `back_line_color` | Backdrop Line Color for the Text Overlay.
**Value:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA`. | ❌ | | `back_line_width` | Backdrop Line Width for the Text Overlay.
**Value:** Integer greater than 0 | ❌ | -| `special_text` | Text Format for Special Text Overlays.
**`special_text` Only works with text overlays** | ❌ | | `addon_offset` | Text Addon Image Offset from the text.
**`addon_offset` Only works with text overlays**
**Value:** Integer 0 or greater | ❌ | | `addon_position` | Text Addon Image Alignment in relation to the text.
**`addon_position` Only works with text overlays**
**Values:** `left`, `right`, `top`, `bottom` | ❌ | diff --git a/modules/config.py b/modules/config.py index 08c526c0..d01266f3 100644 --- a/modules/config.py +++ b/modules/config.py @@ -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 ''}" diff --git a/modules/overlay.py b/modules/overlay.py index 5fc38dc7..acaf837c 100644 --- a/modules/overlay.py +++ b/modules/overlay.py @@ -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) diff --git a/modules/overlays.py b/modules/overlays.py index 9ecfa49c..48ef1cce 100644 --- a/modules/overlays.py +++ b/modules/overlays.py @@ -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: