Skip to content

Fix project-icon.svg not rendering in Collins - #35

Merged
ghackett merged 1 commit into
mainfrom
fix-collins-project-icon
Aug 2, 2026
Merged

Fix project-icon.svg not rendering in Collins#35
ghackett merged 1 commit into
mainfrom
fix-collins-project-icon

Conversation

@ghackett

@ghackett ghackett commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the project-icon.svg added in #34 not actually showing up in Collins' sidebar — Collins was silently falling back to the generic folder icon.

Root cause

Collins rasterizes project icons through gdk-pixbuf's SVG loader (GdkPixbuf.PixbufLoader.new_with_type("svg")), and that loader only recognizes a file as SVG when the <svg tag appears within the first 256 bytes (verified empirically: padding a minimal SVG shows the loader flips from OK to Unsupported image format exactly when <svg moves from byte 257 to byte 258). Our XML declaration plus the 4-line header comment pushed the tag to byte 270, so the loader rejected the file and Collins used its fallback icon.

The original PR verified the file with rsvg-convert, which parses the document with a real XML parser and has no such sniff window — which is why it looked fine there. (Collins' own project-icon.svg also has a leading comment, but a shorter one: its <svg sits at byte 191.)

Fix

Move the header comment inside the <svg> element, so the tag now lands at byte 39. No change to the artwork. The comment also now documents the 256-byte constraint so it doesn't regress.

Verification

Rasterized through the exact loader path Collins uses (PixbufLoader.new_with_type("svg") + set_size) at 16px (sidebar size) and 256px — both succeed, and collins.projecticons.project_icon_data() still accepts the file:

project-icon.svg rendered via gdk-pixbuf at 256px after the fix

🤖 Generated with Claude Code

https://claude.ai/code/session_012SHFReWXKqrmD4hBzUTT6q

gdk-pixbuf's SVG loader (which Collins renders sidebar icons with) only
recognizes a file as SVG when "<svg" appears within the first 256 bytes.
Our header comment pushed the tag to byte 270, so the loader rejected the
file with "Unsupported image format" and Collins fell back to the generic
folder icon. Move the comment inside the <svg> element so the tag lands
at byte 39.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012SHFReWXKqrmD4hBzUTT6q
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

📦 Debug APK from this build

Built from commit 05dc5c7

Download the APK (workflow-run artifact; requires a GitHub login and expires with the run's retention window)

Scan to download on a device:

QR code linking to the APK

@ghackett
ghackett marked this pull request as ready for review August 2, 2026 16:08
@ghackett
ghackett merged commit c075a0a into main Aug 2, 2026
7 checks passed
@ghackett
ghackett deleted the fix-collins-project-icon branch August 2, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant