Fix project-icon.svg not rendering in Collins - #35
Merged
Conversation
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
📦 Debug APK from this buildBuilt from commit Download the APK (workflow-run artifact; requires a GitHub login and expires with the run's retention window) Scan to download on a device: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
project-icon.svgadded 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<svgtag appears within the first 256 bytes (verified empirically: padding a minimal SVG shows the loader flips from OK toUnsupported image formatexactly when<svgmoves 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' ownproject-icon.svgalso has a leading comment, but a shorter one: its<svgsits 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, andcollins.projecticons.project_icon_data()still accepts the file:🤖 Generated with Claude Code
https://claude.ai/code/session_012SHFReWXKqrmD4hBzUTT6q