Skip to content

Skip video poster seek when ffprobe reports no numeric duration - #2570

Open
SAY-5 wants to merge 1 commit into
Piwigo:masterfrom
SAY-5:fix-video-poster-nonnumeric-duration
Open

Skip video poster seek when ffprobe reports no numeric duration#2570
SAY-5 wants to merge 1 commit into
Piwigo:masterfrom
SAY-5:fix-video-poster-nonnumeric-duration

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 18, 2026

Copy link
Copy Markdown

Fixes #2567.

When a video has no duration metadata (for example a webm captured from a stream), ffprobe -show_entries format=duration prints N/A instead of a number. The guard in get_ffmpeg_video_thumb() only checks !empty($O[0]), so N/A passes and floor($O[0]*10) evaluates "N/A" * 10, which is a fatal Unsupported operand types on PHP 8. The upload then silently fails with no gallery entry.

This adds an is_numeric() check so a non-numeric duration falls through to the existing $second = 0 default, matching the reporter's own diagnosis in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Unsupported operand types" error while uploading video

1 participant