From 90f49a5b92125ba6f5fc17aaefa969cf6e17c9e5 Mon Sep 17 00:00:00 2001 From: "Martijn van Berkel (Flitskikker)" Date: Wed, 31 Aug 2022 20:57:27 +0200 Subject: [PATCH] Fix VSF image import with multiple extensions (e.g. .jpeg.png) --- src/ui/Forms/ImportImages.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/Forms/ImportImages.cs b/src/ui/Forms/ImportImages.cs index ac380ea30..1dcc288a8 100644 --- a/src/ui/Forms/ImportImages.cs +++ b/src/ui/Forms/ImportImages.cs @@ -13,6 +13,7 @@ namespace Nikse.SubtitleEdit.Forms { // 0_00_01_042__0_00_03_919_01.jpeg private static readonly Regex TimeCodeFormat1 = new Regex(@"^\d+_\d+_\d+_\d+__\d+_\d+_\d+_\d+_\d+$", RegexOptions.Compiled); + private static readonly Regex TimeCodeFormat1WithExtension = new Regex(@"^\d+_\d+_\d+_\d+__\d+_\d+_\d+_\d+_\d+\..+$", RegexOptions.Compiled); private static readonly Regex TimeCodeFormat2 = new Regex(@"^\d+_\d+_\d+_\d+__\d+_\d+_\d+_\d+$", RegexOptions.Compiled); public Subtitle Subtitle { get; private set; } @@ -99,7 +100,7 @@ namespace Nikse.SubtitleEdit.Forms p.EndTime.TotalMilliseconds = endTime; } } - else if (TimeCodeFormat1.IsMatch(name) || TimeCodeFormat2.IsMatch(name)) + else if (TimeCodeFormat1.IsMatch(name) || TimeCodeFormat1WithExtension.IsMatch(name) || TimeCodeFormat2.IsMatch(name)) { var arr = name.Replace("__", "_").Split('_'); if (arr.Length >= 8)