added image format support for the info command

This commit is contained in:
Frank Skare
2019-07-14 05:52:23 +02:00
parent 7a27ab0513
commit 1699467e0d
2 changed files with 18 additions and 2 deletions

View File

@@ -1,7 +1,8 @@
### 4.7.3
- fix cursor showing load activity on startup
- added file size to info command using audio files
- added file size and type to info command using audio files
- added image format support for the info command
### 4.7.1

View File

@@ -109,7 +109,22 @@ namespace mpvnet
if (genre != "") text += "Genre: " + genre + "\n";
if (date != "") text += "Year: " + date + "\n";
if (duration != "") text += "Length: " + duration + "\n";
text += "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String");
text += "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n";
text += "Type: " + Path.GetExtension(path).ToUpper().TrimStart('.');
mp.commandv("show-text", text, "5000");
return;
}
}
else if (App.ImageTypes.Contains(Path.GetExtension(path).ToLower().TrimStart('.')))
{
using (MediaInfo mediaInfo = new MediaInfo(path))
{
text =
"Width: " + mediaInfo.GetInfo(MediaInfoStreamKind.Image, "Width") + "\n" +
"Height: " + mediaInfo.GetInfo(MediaInfoStreamKind.Image, "Height") + "\n" +
"Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n" +
"Type: " + Path.GetExtension(path).ToUpper().TrimStart('.');
mp.commandv("show-text", text, "5000");
return;