@@ -625,18 +625,18 @@ impl Daemon { |
| 625 | // Stop any existing animation first | 625 | // Stop any existing animation first |
| 626 | self.animation = None; | 626 | self.animation = None; |
| 627 | | 627 | |
| 628 | - // Check if we should animate (GIF, WebP, or APNG with animate flag) | 628 | + // Detect animated formats from URL/path |
| 629 | let source_lower = source.to_lowercase(); | 629 | let source_lower = source.to_lowercase(); |
| 630 | - let is_animatable = source_lower.ends_with(".gif") | 630 | + |
| | 631 | + // Formats that are almost always animated — auto-detect |
| | 632 | + let auto_animate = source_lower.ends_with(".gif") |
| 631 | || source_lower.contains(".gif?") | 633 | || source_lower.contains(".gif?") |
| 632 | || source_lower.contains("/gif/") | 634 | || source_lower.contains("/gif/") |
| 633 | || source_lower.ends_with(".webp") | 635 | || source_lower.ends_with(".webp") |
| 634 | || source_lower.contains(".webp?") | 636 | || source_lower.contains(".webp?") |
| 635 | || source_lower.contains("/webp/") | 637 | || source_lower.contains("/webp/") |
| 636 | || source_lower.ends_with(".apng") | 638 | || source_lower.ends_with(".apng") |
| 637 | - || source_lower.ends_with(".png") // PNG might be APNG | | |
| 638 | || source_lower.contains(".apng?") | 639 | || source_lower.contains(".apng?") |
| 639 | - // Video formats | | |
| 640 | || source_lower.ends_with(".mp4") | 640 | || source_lower.ends_with(".mp4") |
| 641 | || source_lower.ends_with(".webm") | 641 | || source_lower.ends_with(".webm") |
| 642 | || source_lower.ends_with(".mkv") | 642 | || source_lower.ends_with(".mkv") |
@@ -644,16 +644,11 @@ impl Daemon { |
| 644 | || source_lower.ends_with(".mov") | 644 | || source_lower.ends_with(".mov") |
| 645 | || source_lower.ends_with(".m4v"); | 645 | || source_lower.ends_with(".m4v"); |
| 646 | | 646 | |
| 647 | - // Videos should always be animated (no sense displaying a single frame) | 647 | + // PNG needs explicit --animate (most PNGs aren't APNG) |
| 648 | - let is_video = source_lower.ends_with(".mp4") | 648 | + let png_animate = animate && (source_lower.ends_with(".png")); |
| 649 | - || source_lower.ends_with(".webm") | | |
| 650 | - || source_lower.ends_with(".mkv") | | |
| 651 | - || source_lower.ends_with(".avi") | | |
| 652 | - || source_lower.ends_with(".mov") | | |
| 653 | - || source_lower.ends_with(".m4v"); | | |
| 654 | | 649 | |
| 655 | - // Auto-animate videos, or animate if flag is set for other formats | 650 | + // Auto-animate known formats; --animate forces attempt on .png |
| 656 | - let should_animate = is_video || (animate && is_animatable); | 651 | + let should_animate = auto_animate || png_animate; |
| 657 | | 652 | |
| 658 | if should_animate { | 653 | if should_animate { |
| 659 | // Try to start animation | 654 | // Try to start animation |