You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the Kaitai Struct documentation, the idiomatic way to implement Type-Length-Value formats is to use type: switch-on to select the body format for each record (https://doc.kaitai.io/user_guide.html#tlv).
This definitely produces cleaner .ksy files, but the Web IDE does not appear to parse the contents of the record body -- it just shows up as a raw byte array in the Object Tree. This means you cannot debug the contents/parsing of each record type.
In order to see the parsed contents of each record type, you need to replace the switch-on approach with the the (discouraged) approach of conditionally including all possible record types separately.
Switch-on
Conditional Include
body is shown as a raw byte array in the Object Tree
body_1 or body_2 is parsed and displayed correctly in the Object Tree
For example, this is how the example PNG file is displayed:
The text was updated successfully, but these errors were encountered:
For example, this is how the example PNG file is displayed
It works as expected, because the IDAT and IEND chunks are not specifically processed in type/cases, so they fallback to being treated as raw byte arrays:
In order to see the parsed contents of each record type, you need to replace the switch-on approach with the the (discouraged) approach of conditionally including all possible record types separately.
No. Try for example some animated PNGs (APNGs) from https://philip.html5.org/tests/apng/tests.html on this PNG spec - they should have some chunks whose contents are described by the .ksy, so you'll see their inner details.
According to the Kaitai Struct documentation, the idiomatic way to implement Type-Length-Value formats is to use
type: switch-on
to select the body format for each record (https://doc.kaitai.io/user_guide.html#tlv).This definitely produces cleaner .ksy files, but the Web IDE does not appear to parse the contents of the record body -- it just shows up as a raw byte array in the Object Tree. This means you cannot debug the contents/parsing of each record type.
In order to see the parsed contents of each record type, you need to replace the
switch-on
approach with the the (discouraged) approach of conditionally including all possible record types separately.body
is shown as a raw byte array in the Object Treebody_1
orbody_2
is parsed and displayed correctly in the Object TreeFor example, this is how the example PNG file is displayed:
The text was updated successfully, but these errors were encountered: