diff --git a/.github/social-preview-nemo.png b/.github/social-preview-nemo.png index 1a58085..6cbb01f 100644 Binary files a/.github/social-preview-nemo.png and b/.github/social-preview-nemo.png differ diff --git a/.github/social-preview-src/render.py b/.github/social-preview-src/render.py index 2f37e33..5266b8b 100755 --- a/.github/social-preview-src/render.py +++ b/.github/social-preview-src/render.py @@ -29,6 +29,16 @@ def image_magick() -> list[str]: return [executable] +def rsvg_convert() -> str: + # ImageMagick's internal SVG rasterizer silently drops elements with SVG + # filters, which removed the cloud from the PDrive icon. Librsvg renders + # the icon faithfully, including its feDropShadow filter. + executable = shutil.which("rsvg-convert") + if not executable: + raise SystemExit("Librsvg is required (rsvg-convert).") + return executable + + def main() -> int: source_dir = Path(__file__).resolve().parent repo_dir = source_dir.parents[1] @@ -66,7 +76,6 @@ def main() -> int: overlay_svg = work_dir / "overlay.svg" overlay_png = work_dir / "overlay.png" canvas = work_dir / "background.png" - icon_source = work_dir / "icon-source.png" app_icon = work_dir / "icon.png" overlay_svg.write_text(overlay_text, encoding="utf-8") @@ -79,19 +88,7 @@ def main() -> int: check=True, ) subprocess.run( - command - + [ - "-background", - "none", - str(icon), - "-resize", - "256x256", - str(icon_source), - ], - check=True, - ) - subprocess.run( - command + [str(icon_source), "-resize", "142x142", str(app_icon)], + [rsvg_convert(), "-w", "142", "-h", "142", "-o", str(app_icon), str(icon)], check=True, ) subprocess.run( diff --git a/.github/social-preview.png b/.github/social-preview.png index 801e9e9..5898a7d 100644 Binary files a/.github/social-preview.png and b/.github/social-preview.png differ diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7158be9..080c9be 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,6 +26,7 @@ jobs: desktop-file-utils \ gir1.2-ayatanaappindicator3-0.1 \ gir1.2-gtk-3.0 \ + librsvg2-bin \ librsvg2-common \ python3-cairo \ python3-gi \