VideoViewer: rotated (portrait phone) videos shown sideways when system decimal separator is a comma
まだ誰も着手していません。
評価
調査の方向性
回転値は QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs で現在のカルチャを使って解析され、ウィンドウサイズ調整のために QuickLook.Plugin.VideoViewer/Plugin.cs でも再度解析されています。MediaInfo の "Rotation" フィールドに対するこの 2 つの 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.2k
- フォーク
- 1.3k
- 平均マージ
- 10日 4時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QL-Win/QuickLook のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
-
good for a plugin upstream
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
QL-Win/QuickLook の issue をすべて見る
似ている issue
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Fallout-build/Fallout#708 ·
メンテナーはふだん 5 日以内に返信
-
bug next version
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Rem0o/FanControl.Releases#4220 · コメント 1 件 ·
-
area:repo audit:approved audit:auto priority:P3
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
elsa-workflows/elsa-core#8771 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nkdAgility/azure-devops-migration-tools#3217 ·
メンテナーはふだん 1 日以内に返信