diff --git a/src/Forms/BatchConvert.cs b/src/Forms/BatchConvert.cs index 36837dcf0..24f6e0dfd 100644 --- a/src/Forms/BatchConvert.cs +++ b/src/Forms/BatchConvert.cs @@ -2046,7 +2046,9 @@ namespace Nikse.SubtitleEdit.Forms try { var binaryParagraphs = new List(); - if (p.FileName != null && p.FileName.EndsWith(".sup", StringComparison.OrdinalIgnoreCase) && FileUtil.IsBluRaySup(p.FileName) && AllowImageToImage()) + if (p.FileName != null && !p.Subtitle.Paragraphs.Any(s => !string.IsNullOrEmpty(s.Text)) && + p.FileName.EndsWith(".sup", StringComparison.OrdinalIgnoreCase) && + FileUtil.IsBluRaySup(p.FileName) && AllowImageToImage()) { binaryParagraphs = BluRaySupParser.ParseBluRaySup(p.FileName, new StringBuilder()).Cast().ToList(); } diff --git a/src/Logic/CommandLineConvert/CommandLineConverter.cs b/src/Logic/CommandLineConvert/CommandLineConverter.cs index 370a0b1a6..9171afb26 100644 --- a/src/Logic/CommandLineConvert/CommandLineConverter.cs +++ b/src/Logic/CommandLineConvert/CommandLineConverter.cs @@ -1150,7 +1150,7 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert bool targetFormatFound = false; string outputFileName; - if (binaryParagraphs != null && binaryParagraphs.Count > 0) + if (binaryParagraphs != null && binaryParagraphs.Count > 0 && !HasImageTarget(targetFormat)) { using (var vobSubOcr = new VobSubOcr()) { @@ -1764,6 +1764,17 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert } } + private static bool HasImageTarget(string targetFormat) + { + var target = targetFormat.RemoveChar(' '); + + return BatchConvert.BluRaySubtitle.RemoveChar(' ').Equals(target, StringComparison.OrdinalIgnoreCase) || + BatchConvert.VobSubSubtitle.RemoveChar(' ').Equals(target, StringComparison.OrdinalIgnoreCase) || + BatchConvert.DostImageSubtitle.RemoveChar(' ').Equals(target, StringComparison.OrdinalIgnoreCase) || + BatchConvert.BdnXmlSubtitle.RemoveChar(' ').Equals(target, StringComparison.OrdinalIgnoreCase) || + BatchConvert.FcpImageSubtitle.RemoveChar(' ').Equals(target, StringComparison.OrdinalIgnoreCase); + } + internal static Subtitle RunActions(TextEncoding targetEncoding, Subtitle sub, SubtitleFormat format, List actions, bool autoDetectLanguage) { if (actions != null)