VideoViewer: rotated (portrait phone) videos shown sideways when system decimal separator is a comma
还没有人认领这个 Issue。
评估
调研方向
旋转值在 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 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QL-Win/QuickLook 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 60/100
-
[Bug] If the first character entered into the search box is a space, the preview window will close.未关闭
难度 2/5 1-3 小时 新手友好度 67/100
-
[Bug] MSI installer does not display the correct application icon in Windows Programs and Features未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 4/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 58/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
KnifeLemon/Filee#363 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
-
area-Native untriaged
难度 2/5 1-3 小时 新手友好度 76/100
dotnet/machinelearning#7837 ·
维护者通常 2 天内回复
-
[CI] .trgen-ignore required for several grammars.可能已有人在做 @kaby76 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
antlr/grammars-v4#5073 ·
维护者通常 1 天内回复
-
[Enhancement]: Add a search box to the Time Zone dropdown可能已有人在做 @idumlupinar 今天认领。 未关闭Status: New
难度 2/5 1-3 小时 新手友好度 85/100
dnnsoftware/Dnn.Platform#7579 ·
维护者通常 2 天内回复