KTX-Specification icon indicating copy to clipboard operation
KTX-Specification copied to clipboard

It may make sense to rewrite the specs defining binary structures here from pseudocode into Kaitai Struct

Open KOLANICH opened this issue 5 years ago • 6 comments

This would allow to automatically generate parsers for them for multiple languages.

KOLANICH avatar Mar 14 '21 19:03 KOLANICH

Until you opened this issue I was unaware of Kaitai. Thanks for pointing it out to me. I took a look at the web site and also at the Kaitai definition for PNG. My conclusions are:

  1. I would like to provide a Kaitai struct for .ktx2.
  2. It is more complicated than I have time to learn.
  3. It is too complex (maybe just long-winded) for me to want to replace the short pseudo-code at the start of the spec. with it.

I would welcome a contribution of a .ktx2 definition.

I am curious about the intended meaning of kaitai. The kanji character used on the web page is 力 (ryoku) which means power. However none of the homonyms of "kaitai" that I am aware of use 力 and all have fairly negative meanings, e.g. demolish, coastal erosion, absconding with money. Maybe it doesn't come from Japanese even though it sounds like it.

MarkCallow avatar May 05 '21 06:05 MarkCallow

I am curious about the intended meaning of kaitai.

I think they meant something like disassembly / dismantling.

lexaknyazev avatar May 05 '21 07:05 lexaknyazev

I am curious about the intended meaning of kaitai. The kanji character used on the web page is 力 (ryoku) which means power. However none of the homonyms of "kaitai" that I am aware of use 力 and all have fairly negative meanings, e.g. demolish, coastal erosion, absconding with money. Maybe it doesn't come from Japanese even though it sounds like it.

It is named after https://en.wikipedia.org/wiki/Kaitai_Shinsho .

KOLANICH avatar May 10 '21 19:05 KOLANICH

@KOLANICH can you provide a Kaitai struct for .ktx2?

MarkCallow avatar Nov 30 '22 12:11 MarkCallow

armijnhemel has already partially implemented ktx1 in https://github.com/kaitai-io/kaitai_struct_formats/pull/547 , I can look into implementing ktx2 somewhen, but currently no ETA, since I'm currently busy (well, I'm almost always busy, it is even written in my GH profile that I'm extremily busy ⌛😉) and there are some specs I am going to implement (currently the one for safetensors is the first in my list and I have already started working on it).

Anyone can feel free to start working on it, just please make an announce about that.

Also: a prereq for working on any format parser is a suite of files that

  1. utilize every feature of the format
  2. small enough to be easily observed in a hex editor.

So it'd be nice to have such a suite, if it doesn't exist.

KOLANICH avatar Nov 30 '22 21:11 KOLANICH

Also: a pre-req for working on any format parser is a suite of files that

Work is about to start that includes improving the test suite for KTX-Software. Something like this will emerge.

MarkCallow avatar Dec 01 '22 08:12 MarkCallow