Library art: real gameplay instead of GitHub social cards; accept GIF sources

GitHub's opengraph preview is repo text, stats and an identicon; as a Steam hero
it looked broken. GitHub entries no longer default to it (the store draws its
fallback, Steam gets generated art). Source GIFs (common gameplay captures) are
accepted; the Frame's Chromium draws the first frame. Open Saber Plus uses its
gameplay GIF as banner. Verified on the Frame: hero/wide now show gameplay.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-09-28 23:12:24 +10:00
1 parent 7990553620
commit b5caee5b86
5 files changed
+18 -9

No files matched your search

+2 -1
View File
@@ -35,7 +35,8 @@ def _entry(source, c, approved=True):
artwork = c.get('images') or {}
icon = artwork.get('icon') or c.get('icon') or 'https://github.com/' + c['repo'].split('/')[0] + '.png'
images = {'icon': icon,
'banner': artwork.get('banner') or 'https://opengraph.githubassets.com/1/' + c['repo'],
# No GitHub social-preview card: it's repo text and stats, not art; the UI draws a fallback.
'banner': artwork.get('banner'),
'screenshots': list(artwork.get('screenshots') or [])}
return {'source': source['id'], 'id': c['repo'], 'package': None,
'name': c['name'], 'summary': c.get('summary') or '', 'icon': icon,
+2 -2
View File
@@ -9,7 +9,7 @@
"allow_prerelease": false,
"images": {
"icon": "https://raw.githubusercontent.com/KhronosGroup/OpenXR-SDK-Source/3ed64d0f9bb680f24b80a085091e5c8fab38f7b7/src/tests/hello_xr/android_resources/vulkan/mipmap-xxxhdpi/ic_helloxr_launcher.png",
"banner": "https://opengraph.githubassets.com/1/KhronosGroup/OpenXR-SDK-Source",
"banner": null,
"screenshots": []
},
"icon": "https://raw.githubusercontent.com/KhronosGroup/OpenXR-SDK-Source/3ed64d0f9bb680f24b80a085091e5c8fab38f7b7/src/tests/hello_xr/android_resources/vulkan/mipmap-xxxhdpi/ic_helloxr_launcher.png"
@@ -60,7 +60,7 @@
"allow_prerelease": false,
"images": {
"icon": "https://raw.githubusercontent.com/arpruss/OpenSaberPlus/8c5295cdaadf02ea7418b0c6cbea20240ba913af/icon.png",
"banner": "https://opengraph.githubassets.com/1/arpruss/OpenSaberPlus",
"banner": "https://raw.githubusercontent.com/arpruss/OpenSaberPlus/8c5295cdaadf02ea7418b0c6cbea20240ba913af/doc/images/OS0.4.0_1.gif",
"screenshots": [
"https://raw.githubusercontent.com/arpruss/OpenSaberPlus/8c5295cdaadf02ea7418b0c6cbea20240ba913af/doc/images/OS0.4.0_1.gif",
"https://raw.githubusercontent.com/arpruss/OpenSaberPlus/8c5295cdaadf02ea7418b0c6cbea20240ba913af/doc/images/OS0.4.0_2.gif",
+7 -1
View File
@@ -34,6 +34,12 @@ def image_type(data):
if data.startswith(PNG):
png_size(data)
return 'png'
if data[:6] in (b'GIF87a', b'GIF89a') and len(data) >= 10:
# Gameplay GIFs are common source screenshots; the Frame's Chromium draws their first frame.
w, h = struct.unpack_from('<HH', data, 6)
if w and h and w * h <= MAX_PIXELS and max(w, h) <= 8192:
return 'gif'
raise ValueError('artwork GIF has unsupported dimensions')
if data.startswith(b'\xff\xd8'):
# Check JPEG SOF dimensions without depending on an image library; trailing padding is fine.
pos = 2
@@ -52,7 +58,7 @@ def image_type(data):
return 'jpg'
break
pos += size
raise ValueError('artwork must be a supported PNG or JPEG')
raise ValueError('artwork must be a supported PNG, JPEG or GIF')
def fetch(value, deadline=None):