From ce27b2a5db34241f9ec6bba6f09fdc127c6153c8 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 23 Aug 2015 09:50:49 +0400 Subject: [PATCH] YKG image format variation. --- ArcFormats/Yuka/ImageYKG.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ArcFormats/Yuka/ImageYKG.cs b/ArcFormats/Yuka/ImageYKG.cs index 098c8d24..ea93b4aa 100644 --- a/ArcFormats/Yuka/ImageYKG.cs +++ b/ArcFormats/Yuka/ImageYKG.cs @@ -63,8 +63,12 @@ namespace GameRes.Formats.Yuka DataOffset = LittleEndian.ToUInt32 (header, 0x28), DataSize = LittleEndian.ToUInt32 (header, 0x2C) }; + if (0 == ykg.DataOffset) + ykg.DataOffset = LittleEndian.ToUInt32 (header, 8); if (ykg.DataOffset < 0x30) return null; + if (0 == ykg.DataSize) + ykg.DataSize = (uint)(stream.Length - ykg.DataOffset); ImageMetaData info = null; using (var img = new StreamRegion (stream, ykg.DataOffset, ykg.DataSize, true)) { @@ -89,10 +93,6 @@ namespace GameRes.Formats.Yuka info = Png.ReadMetaData (png); ykg.Format = YkgImage.Gnp; } - else - { - return null; - } } if (null == info) return null;