Try to fix #762: video rotation metadata is not consistent across platforms

This commit is contained in:
Paddy Xu
2021-02-21 18:49:38 +01:00
parent dc87c32af0
commit 929dbe9d14

View File

@@ -82,6 +82,9 @@ namespace QuickLook.Plugin.VideoViewer
int.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Width"), out var width); int.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Width"), out var width);
int.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Height"), out var height); int.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Height"), out var height);
double.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Rotation"), out var rotation); double.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
// Correct rotation: on some machine the value "90" becomes "90000" by some reason
if (rotation > 360)
rotation /= 1e3;
var windowSize = new Size var windowSize = new Size
{ {