Another fix for image splitter

This commit is contained in:
Nikolaj Olsson 2020-06-05 15:39:59 +02:00
parent 12b30549e0
commit 8437695425
2 changed files with 4 additions and 4 deletions

View File

@ -1363,7 +1363,7 @@ namespace Nikse.SubtitleEdit.Core
for (int y = 0; y < Height; y++)
{
var isLineTransparent = IsLineTransparent(y);
if (startY == y && !isLineTransparent)
if (startY == y && isLineTransparent)
{
startY++;
continue;
@ -1379,7 +1379,7 @@ namespace Nikse.SubtitleEdit.Core
}
}
return startY - transparentBottomPixels;
return Height - startY - transparentBottomPixels;
}

View File

@ -522,7 +522,7 @@ namespace Nikse.SubtitleEdit.Logic
}
}
if (bmp.Height - startY > minLineHeight)
if (bmp.Height - startY > 1)
{
var part = bmp.CopyRectangle(new Rectangle(0, startY, bmp.Width, bmp.Height - startY));
if (!part.IsImageOnlyTransparent())
@ -722,7 +722,7 @@ namespace Nikse.SubtitleEdit.Logic
}
}
if (bmp.Height - startY > minLineHeight && parts.Count > 0)
if (bmp.Height - startY > 1 && parts.Count > 0)
{
var part = bmp.CopyRectangle(new Rectangle(0, startY, bmp.Width, bmp.Height - startY));
if (!part.IsImageOnlyTransparent())