Feature: Flash file thumbnail generation via Ruffle headless #83
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Aroy/Gallery-Archivist#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Area: Backend / File processing pipeline
Background
Flash (
.swf) files are supported for playback via Ruffle in the frontend, but they have no thumbnail. Post cards show a static icon fallback. All other media types (video, PDF, image, GIF) generate thumbnails on import.Proposed solution
Add a
generate_flash_thumbnailCelery task that invokes the Ruffle CLI in headless/screenshot mode to render frame 1 of the SWF as a PNG thumbnail.This mirrors the existing
generate_video_thumbnail(ffmpegthumbnailer) andgenerate_pdf_thumbnail(pdf2image) tasks — same_update_file_model/_setup_output_pathhelpers, same deduplication logic.Wire it into
utils.pyalongside the other post-import async dispatches:Once thumbnails exist, the frontend post card already conditionally uses
item.urls.smfor flash items and only falls back to the icon when absent.Implementation checklist
Caveats / known limitations
Flash is inherently interactive/dynamic — frame 1 may be a loading screen or blank. The best option is Ruffle's headless renderer.
How Ruffle headless works
Ruffle ships a ruffle desktop binary with a
--screenshotflag that renders frame 1 and outputs a PNG. No X display needed with the software renderer.ruffle --screenshot /tmp/thumb.png /path/to/file.swfYou'd need the ruffle binary available in your Docker image. The nightly builds include it.
Implementation
Add to
backend/apps/files/tasks.py:Hook it into utils.py alongside the PDF/video cases:
Caveats
RUFFLE_RENDERER=software)Installing Ruffle in Docker