Fix for finding img files in SatBoxPng

This commit is contained in:
Nikolaj Olsson 2017-09-06 21:49:38 +02:00
parent 41cccb9863
commit f5dd12a1c0

View File

@ -38,7 +38,15 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
try
{
if (path != null && File.Exists(Path.Combine(path, text)))
{
text = Path.Combine(path, text);
}
else if (path != null)
{
int indexOfSlash = text.LastIndexOf("/", StringComparison.Ordinal);
if (indexOfSlash >= 0 && File.Exists(Path.Combine(path, text.Remove(0, indexOfSlash + 1))))
text = Path.Combine(path, text.Remove(0, indexOfSlash + 1));
}
p = new Paragraph(DecodeTimeCode(start), DecodeTimeCode(end), text);
subtitle.Paragraphs.Add(p);
}