feat: Add configurable thumbnail GIF generation with automatic mode #1451
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.
Implement configurable thumbnail GIF generation settings that allow automatic calculation based on video duration or manual configuration override. This addresses issue #1450.
Changes:
Add Django settings for GIF generation configuration:
Implement automatic mode that evenly distributes frames across entire video duration when enabled, calculating optimal FPS automatically
Maintain backward compatibility: default behavior (auto_mode=False) preserves original hardcoded values (start=3s, duration=25s, fps=1)
Add edge case handling:
Benefits:
Files modified:
Description
Usage Examples
Example 1: Default Behavior (Backward Compatible)
Example 2: Manual Configuration
Example 3: Automatic Mode - 5 Frames Across Entire Video
Example 4: Automatic Mode - Custom Duration
Backward Compatibility
Fully backward compatible - Default behavior (THUMBNAIL_GIF_AUTO_MODE = False) produces identical results to the original hardcoded implementation:
Same start position (3 seconds)
Same duration (25 seconds)
Same frame rate (1 fps)
Same number of frames (25 frames)
Existing installations will continue to work without any configuration changes.
Steps
Pre-deploy
THUMBNAIL_GIF_*settings inlocal_settings.pymatch your requirementsPost-deploy