Kaitai Struct: declarative binary format parsing language

https://news.ycombinator.com/rss Hits: 17
Summary

std::ifstream ifs("path/to/some.gif", std::ifstream::binary); kaitai::kstream ks(&ifs); gif_t g = gif_t(&ks); std::cout << "width = " << g.logical_screen()->image_width() << std::endl; std::cout << "height = " << g.logical_screen()->image_height() << std::endl; Gif g = Gif.FromFile("path/to/some.gif"); Console.WriteLine("width = " + g.LogicalScreen.ImageWidth); Console.WriteLine("height = " + g.LogicalScreen.ImageHeight); file, err := os.Open("path/to/some.gif") g := NewGif() err = g.Read(kaitai.NewStream(file), nil, g) fmt.Printf("width = %d\n", g.LogicalScreen.ImageWidth) fmt.Printf("height = %d\n", g.LogicalScreen.ImageHeight) Gif g = Gif.fromFile("path/to/some.gif"); System.out.println("width = " + g.logicalScreen().imageWidth()); System.out.println("height = " + g.logicalScreen().imageHeight()); var g = new Gif(new KaitaiStream(someArrayBuffer)); console.log("width = " + g.logicalScreen.imageWidth); console.log("height = " + g.logicalScreen.imageHeight); local g = Gif:from_file("path/to/some.gif") print("width = " .. g.logical_screen.image_width) print("height = " .. g.logical_screen.image_height) let g = Gif.fromFile("path/to/some.gif") echo "width = " & $g.logicalScreen.imageWidth echo "height = " & $g.logicalScreen.imageHeight my $g = Gif->from_file("path/to/some.gif"); print("width = ", $g->logical_screen()->image_width(), "\n"); print("height = ", $g->logical_screen()->image_height(), "\n"); $g = Gif::fromFile("path/to/some.gif"); print("width = " . $g->logicalScreen()->imageWidth() . "\n"); print("height = " . $g->logicalScreen()->imageHeight() . "\n"); g = Gif.from_file("path/to/some.gif") print("width = %d" % (g.logical_screen.image_width)) print("height = %d" % (g.logical_screen.image_height)) g = Gif.from_file("path/to/some.gif") puts "width = #{g.logical_screen.image_width}" puts "height = #{g.logical_screen.image_height}" let bytes = fs::read("path/to/some.gif").unwrap(); let io = BytesReader::from(bytes); let g: OptRc<Gif> = Gif::read_into(&io, Non...

First seen: 2025-10-23 19:32

Last seen: 2025-10-24 11:36