Add rectangle scaling fix for bclim creation

Thanks slashmolder for help debugging!
This commit is contained in:
Kurt
2015-07-06 20:51:35 -07:00
parent aa3832501c
commit 37427e0d34

View File

@@ -432,14 +432,14 @@ internal static int write16BitColorPalette(Bitmap img, ref MemoryStream ms)
}
return 7;
}
internal static void writeGeneric(int format, Bitmap img, ref MemoryStream ms)
internal static void writeGeneric(int format, Bitmap img, ref MemoryStream ms, bool rectangle = true)
{
int w = img.Width;
int h = img.Height;
// square format. Yay.
w = h = Math.Max(nlpo2(w),nlpo2(h));
if (format == 0 && Math.Min(img.Width, img.Height) > 64)
if (rectangle && Math.Min(img.Width, img.Height) > 64)
{
w = nlpo2(img.Width);
h = nlpo2(img.Height);