|
5 | 5 |
|
6 | 6 |  |
7 | 7 |
|
8 | | -Bound Book Format (.bbf) is a high-performance, archival-grade binary container designed specifically for digital comic books and manga. Unlike CBR/CBZ, BBF is built for DirectSotrage/mmap, easy integrity checks, and mixed-codec containerization. |
| 8 | +Bound Book Format (.bbf) is a high-performance binary container designed specifically for digital comic books and manga. Unlike CBR/CBZ, BBF is built for DirectSotrage/mmap, easy integrity checks, and mixed-codec containerization. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +### Prerequisites |
| 15 | +- C++17 compliant compiler (GCC/Clang/MSVC) |
| 16 | +- [xxHash](https://github.com/Cyan4973/xxHash) library |
| 17 | + |
| 18 | +### Compilation |
| 19 | +Linux |
| 20 | +```bash |
| 21 | +g++ -std=c++17 bbfenc.cpp libbbf.cpp xxhash.c -o bbfmux |
| 22 | +``` |
| 23 | + |
| 24 | +Windows |
| 25 | +```bash |
| 26 | +g++ -std=c++17 bbfmux.cpp libbbf.cpp xxhash.c -o bbfmux -municode |
| 27 | +``` |
| 28 | + |
| 29 | +--- |
9 | 30 |
|
10 | 31 | ## Technical Details |
11 | 32 | BBF is designed as a Footer-indexed binary format. This allows for rapid append-only creation and immediate random access to any page without scanning the entire file. |
@@ -81,61 +102,59 @@ The `bbfmux` utility provides a powerful interface for managing Bound Book files |
81 | 102 | ## Usage Examples |
82 | 103 |
|
83 | 104 | ### Create a new BBF |
84 | | -You can mix individual images and folders. `bbfmux` will sort inputs alphabetically, deduplicate identical assets, and align data to 4KB boundaries. |
85 | | - |
86 | | -NOTE: It's not quite implemented yet in the CLI, but the `AssetTable` enables you to specify custom reading orders. |
| 105 | +You can mix individual images and folders. `bbfmux` sorts inputs alphabetically, deduplicates identical assets, and aligns data to 4096-byte boundaries. |
87 | 106 |
|
88 | 107 | ```bash |
| 108 | +# Basic creation with metadata |
89 | 109 | bbfmux cover.png ./chapter1/ endcard.png \ |
90 | | - --section="Cover":1 \ |
91 | | - --section="Chapter 1":2 \ |
92 | | - --section="Credits":24 \ |
93 | 110 | --meta=Title:"Akira" \ |
94 | 111 | --meta=Author:"Katsuhiro Otomo" \ |
| 112 | + --meta=Tags:"[Action, Sci-Fi, Cyberpunk]" \ |
95 | 113 | akira.bbf |
96 | 114 | ``` |
97 | 115 |
|
| 116 | +### Hierarchical Sections (Volumes & Chapters) |
| 117 | +BBF supports nesting sections. By defining a Parent relationship, you can group chapters into volumes. This allows readers to display a nested Table of Contents and enables bulk-extraction of entire volumes. |
| 118 | + |
| 119 | +**Syntax:** `--section="Name":Page[:ParentName]` |
| 120 | + |
| 121 | +```bash |
| 122 | +# Create a book with nested chapters |
| 123 | +bbfmux ./manga_folder/ \ |
| 124 | + --section="Volume 1":1 \ |
| 125 | + --section="Chapter 1":1:"Volume 1" \ |
| 126 | + --section="Chapter 2":20:"Volume 1" \ |
| 127 | + --section="Volume 2":180 \ |
| 128 | + --section="Chapter 3":180:"Volume 2" \ |
| 129 | + manga.bbf |
| 130 | +``` |
| 131 | + |
98 | 132 | ### Verify Integrity |
99 | | -Scan for bit-rot or data corruption. Will tell you which assets are corrupted. |
| 133 | +Scan the archive for bit-rot or data corruption. BBF uses **[XXH3_64](https://github.com/Cyan4973/xxHash)** hashes to verify every individual image payload. |
100 | 134 | ```bash |
101 | 135 | bbfmux input.bbf --verify |
102 | 136 | ``` |
103 | 137 |
|
104 | 138 | ### Extract Data |
105 | | -Extract a specific section or the entire book. |
| 139 | +Extract the entire book, a specific volume, or a single chapter. When extracting a parent section (like a Volume), `bbfmux` automatically includes all child chapters. |
| 140 | + |
| 141 | +**Extract a specific section:** |
106 | 142 | ```bash |
107 | | -bbfmux input.bbf --extract --section="Chapter 1" --outdir="./chapter1" |
| 143 | +bbfmux input.bbf --extract --section="Volume 1" --outdir="./Volume1" |
108 | 144 | ``` |
109 | 145 |
|
110 | | -Extract the entire book |
| 146 | +**Extract the entire book:** |
111 | 147 | ```bash |
112 | 148 | bbfmux input.bbf --extract --outdir="./unpacked_book" |
113 | 149 | ``` |
114 | 150 |
|
115 | | -### View Metadata |
116 | | -View the metadata for the .bbf file. |
| 151 | +### View Metadata & Structure |
| 152 | +View the version, page count, deduplication stats, hierarchical sections, and all embedded metadata. |
117 | 153 | ```bash |
118 | 154 | bbfmux input.bbf --info |
119 | 155 | ``` |
120 | 156 |
|
121 | 157 | --- |
122 | 158 |
|
123 | | -## Getting Started |
124 | | - |
125 | | -### Prerequisites |
126 | | -- C++17 compliant compiler (GCC/Clang/MSVC) |
127 | | -- [xxHash](https://github.com/Cyan4973/xxHash) library |
128 | | - |
129 | | -### Compilation |
130 | | -Linux |
131 | | -```bash |
132 | | -g++ -std=c++17 bbfenc.cpp libbbf.cpp xxhash.c -o bbfmux |
133 | | -``` |
134 | | - |
135 | | -Windows |
136 | | -```bash |
137 | | -g++ -std=c++17 bbfmux.cpp libbbf.cpp xxhash.c -o bbfmux -municode |
138 | | -``` |
139 | | - |
140 | 159 | ## License |
141 | 160 | Distributed under the MIT License. See `LICENSE` for more information. |
0 commit comments