mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(PBM): workaround for cropped images.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace GameRes.Formats.Nekopunch
|
|||||||
if (!file.Name.HasExtension (".pbm"))
|
if (!file.Name.HasExtension (".pbm"))
|
||||||
return null;
|
return null;
|
||||||
var header = file.ReadHeader (8);
|
var header = file.ReadHeader (8);
|
||||||
if (!header.AsciiEqual (5, "BM"))
|
if ((header[4] & 7) != 7 || !header.AsciiEqual (5, "BM"))
|
||||||
return null;
|
return null;
|
||||||
using (var bmp = OpenBitmapStream (file, header.ToUInt32 (0)))
|
using (var bmp = OpenBitmapStream (file, header.ToUInt32 (0)))
|
||||||
return Bmp.ReadMetaData (bmp);
|
return Bmp.ReadMetaData (bmp);
|
||||||
@@ -57,7 +57,7 @@ namespace GameRes.Formats.Nekopunch
|
|||||||
{
|
{
|
||||||
file.Position = 4;
|
file.Position = 4;
|
||||||
Stream input = new LzssStream (file.AsStream, LzssMode.Decompress, true);
|
Stream input = new LzssStream (file.AsStream, LzssMode.Decompress, true);
|
||||||
input = new LimitStream (input, unpacked_size);
|
input = new LimitStream (input, unpacked_size, StreamOption.Fill);
|
||||||
return new BinaryStream (input, file.Name);
|
return new BinaryStream (input, file.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user