Skip to content

Fix culture-dependent video rotation parsing - #2032

Open
MORTEM3845 wants to merge 2 commits into
QL-Win:masterfrom
MORTEM3845:codex/fix-video-rotation-culture
Open

MORTEM3845 wants to merge 2 commits into
QL-Win:masterfrom
MORTEM3845:codex/fix-video-rotation-culture

Conversation

@MORTEM3845

@MORTEM3845 MORTEM3845 commented Oct 23, 2026 •

Copy link
Copy Markdown

PR Checklist

  • Functionality has been tested, no obvious bugs
  • Code style follows project conventions
  • Documentation/comments updated (if applicable)

Brief Description of Changes

Parse rotation with invariant culture so 90.000 becomes 90 in every locale, avoiding 90000 (de-DE) or 0 (ru-RU). Remove the obsolete divide-by-1000 workaround.

Related Issue (if any)

Fixes #2020

Additional Notes

Verified Plugin.Prepare/View with ru-RU, de-DE and en-US; build passes. Visual capture was unavailable.

Summary by CodeRabbit

  • Bug Fixes
    • Video rotation values now handle decimal values consistently, regardless of regional number-format settings.
    • Rotation values greater than 360° are no longer scaled down, preserving the rotation reported by the video metadata. This improves how videos with larger rotation values are displayed.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c02b664a-ea6e-40c3-a794-981ac8d6819b
📥 Commits

Reviewing files that changed from the base of the PR and between e14e089 and cfebd96.

📒 Files selected for processing: 2
  • QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs
  • QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs
🚧 Files skipped from review as they are similar to previous changes: 2
  • QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs
  • QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

Plugin.Prepare and ViewerPanel.LoadAndPlay now parse video rotation metadata with invariant-culture floating-point rules. Both methods remove the adjustment that divided parsed values greater than 360 by 1,000. XML documentation was added to both methods.

Changes: Video rotation parsing

Layer / File(s) Summary
Parse rotation consistently
QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs
Both parsing sites use NumberStyles.Float and CultureInfo.InvariantCulture. Both remove the division applied to values greater than 360. XML documentation was added to Prepare and LoadAndPlay.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: xupefei

Merge Risk: ⚪ Minimal · up to cfebd

No actionable issue was identified that would prevent merging this rotation-parsing change after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: fixing culture-dependent video rotation parsing.
Linked Issues check Passed Issue #2020 requires invariant-culture parsing of MediaInfo Rotation in ViewerPanel.xaml.cs and Plugin.cs. The PR uses NumberStyles.Float with CultureInfo.InvariantCulture at both call sites…
Out of Scope Changes check Passed The reported changes are limited to the two rotation-parsing fixes, required imports, related comments, and removal of the obsolete workaround. These changes directly support issue #2020. No unrelated…
Full details: Linked Issues check

Explanation

Issue #2020 requires invariant-culture parsing of MediaInfo Rotation in ViewerPanel.xaml.cs and Plugin.cs. The PR uses NumberStyles.Float with CultureInfo.InvariantCulture at both call sites and removes the obsolete divide-by-1000 correction. This addresses 90.000 parsing for comma and dot system cultures. No automated test requirement is stated in the issue.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to the two rotation-parsing fixes, required imports, related comments, and removal of the obsolete workaround. These changes directly support issue #2020. No unrelated behavior or API changes are reported.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

VideoViewer: rotated (portrait phone) videos shown sideways when system decimal separator is a comma

1 participant