Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#2,020 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp
领域
desktop

调研方向

旋转值在 QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs 中按当前区域性解析,在 QuickLook.Plugin.VideoViewer/Plugin.cs 中为窗口尺寸计算再次解析。请从 MediaInfo 的 "Rotation" 字段上这两处 double.TryParse 调用开始。完成标准是两处都使用 CultureInfo.InvariantCulture 和 NumberStyles.Float 解析,并且 ru-RU 区域设置下竖屏视频能正确显示为直立。同时检查现有的 rotation /= 1e3 变通方法是否仍然成立。

由索引模型根据 Issue 内容生成。

描述

Describe the bug Portrait videos recorded on iPhone (stored as 1920x1080 with a rotation flag) are previewed sideways. This is likely the root cause of #762, which was closed without being reproduced.

Cause MediaInfo returns the rotation as "90.000". The VideoViewer parses it with the current culture:

QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs — double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
QuickLook.Plugin.VideoViewer/Plugin.cs — same call for the window size
When the decimal separator is a comma (ru-RU, uk-UA, many other locales), "90.000" fails to parse, so rotation stays 0 and no rotation is applied. With a dot as the group separator (de-DE etc.), it parses as 90000. The existing if (rotation > 360) rotation /= 1e3; workaround covers that case, but not the comma-separator case.

Proposed fix Parse the value with the invariant culture in both places:

double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"),
NumberStyles.Float, CultureInfo.InvariantCulture, out var rotation);
After this change, the /= 1e3 workaround is probably no longer needed.

To Reproduce

Windows region format ru-RU (decimal separator ,).
Take a portrait iPhone video (HEVC .MOV, rotation=-90 in ffprobe, MediaInfo Rotation = 90.000).
Preview it in QuickLook. It is shown sideways.
Change the decimal separator to . and restart QuickLook. It is shown correctly.
Environment

Windows 11 Home 24H2 (10.0.26100)
QuickLook 4.5.0.0 (Microsoft Store)

主要语言
C#
星标
25.3k
派生
1.3k
平均合并
6 天 23 小时
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

QL-Win/QuickLook 的其他 Issue

查看 QL-Win/QuickLook 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。