Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/social-preview-nemo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 11 additions & 14 deletions .github/social-preview-src/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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")

Expand All @@ -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(
Expand Down
Binary file modified .github/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Loading