mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-25 04:14:13 +08:00
YKG image format variation.
This commit is contained in:
parent
ab19d0b0e3
commit
ce27b2a5db
@ -63,8 +63,12 @@ namespace GameRes.Formats.Yuka
|
|||||||
DataOffset = LittleEndian.ToUInt32 (header, 0x28),
|
DataOffset = LittleEndian.ToUInt32 (header, 0x28),
|
||||||
DataSize = LittleEndian.ToUInt32 (header, 0x2C)
|
DataSize = LittleEndian.ToUInt32 (header, 0x2C)
|
||||||
};
|
};
|
||||||
|
if (0 == ykg.DataOffset)
|
||||||
|
ykg.DataOffset = LittleEndian.ToUInt32 (header, 8);
|
||||||
if (ykg.DataOffset < 0x30)
|
if (ykg.DataOffset < 0x30)
|
||||||
return null;
|
return null;
|
||||||
|
if (0 == ykg.DataSize)
|
||||||
|
ykg.DataSize = (uint)(stream.Length - ykg.DataOffset);
|
||||||
ImageMetaData info = null;
|
ImageMetaData info = null;
|
||||||
using (var img = new StreamRegion (stream, ykg.DataOffset, ykg.DataSize, true))
|
using (var img = new StreamRegion (stream, ykg.DataOffset, ykg.DataSize, true))
|
||||||
{
|
{
|
||||||
@ -89,10 +93,6 @@ namespace GameRes.Formats.Yuka
|
|||||||
info = Png.ReadMetaData (png);
|
info = Png.ReadMetaData (png);
|
||||||
ykg.Format = YkgImage.Gnp;
|
ykg.Format = YkgImage.Gnp;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (null == info)
|
if (null == info)
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user