mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Fix batch convert of blu-ray sup file to vobsub - thx John :)
This commit is contained in:
parent
7540f414c4
commit
db19d09cc5
@ -2046,7 +2046,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
try
|
||||
{
|
||||
var binaryParagraphs = new List<IBinaryParagraph>();
|
||||
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<IBinaryParagraph>().ToList();
|
||||
}
|
||||
|
@ -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<BatchAction> actions, bool autoDetectLanguage)
|
||||
{
|
||||
if (actions != null)
|
||||
|
Loading…
Reference in New Issue
Block a user