30 file formats, every one generated at an exact size
Each of these is a real file of that format. It opens in the software that owns it, and it is exactly the number of bytes you asked for. None of them is padded zeros with an extension bolted on.
| Format | Name | Extension | Smallest file | Fidelity | Checked against |
|---|---|---|---|---|---|
avif |
AV1 Image File Format | .avif |
311 | full | pillow |
bmp |
Windows Bitmap | .bmp |
58 | full | pillow |
csv |
Comma-Separated Values | .csv |
115 | full | python-csv |
docx |
Word (Office Open XML) | .docx |
1220 | full | libreoffice |
eml |
Email message | .eml |
289 | full | python-email |
geojson |
GeoJSON | .geojson |
875 | full | gdal-geojson |
gif |
Graphics Interchange Format | .gif |
114 | full | pillow |
html |
HyperText Markup Language | .html |
118 | full | python-html |
ico |
Windows Icon | .ico |
70 | full | pillow |
jpg |
JPEG | .jpg |
602 | full | pillow |
json |
JavaScript Object Notation | .json |
219 | full | node-json |
jxl |
JPEG XL | .jxl |
147 | full | pillow-jxl |
log |
Server and application log | .log |
155 | full | not applicable |
md |
Markdown | .md |
0 | full | not applicable |
mp4 |
MP4 video | .mp4 |
3312 | full | libaom |
pdf |
Portable Document Format | .pdf |
3415 | full | pdftotext |
png |
Portable Network Graphics | .png |
74 | full | pillow |
pptx |
PowerPoint (Office Open XML) | .pptx |
4809 | full | libreoffice |
svg |
Scalable Vector Graphics | .svg |
194 | full | inkscape |
targz |
tar + gzip | .tar.gz |
9790 | full | 7z |
tiff |
Tagged Image File Format | .tiff |
183 | full | pillow |
toml |
TOML | .toml |
212 | full | python-toml |
txt |
Plain text | .txt |
0 | full | not applicable |
wav |
Waveform Audio | .wav |
98 | full | ffprobe |
webm |
WebM video | .webm |
3284 | full | libaom |
webp |
WebP | .webp |
148 | full | pillow |
xlsx |
Excel (Office Open XML) | .xlsx |
1726 | full | libreoffice |
xml |
Extensible Markup Language | .xml |
264 | full | python-xml |
yaml |
YAML | .yaml |
241 | full | python-yaml |
zip |
ZIP | .zip |
8382 | full | 7z |
What the columns mean
-
Smallest file
The fewest bytes this tool will accept for that format, including the label it writes inside the file. Ask for less and you get an error naming the floor and the reason for it, never a file of the wrong size.
-
Fidelity
How complete the file is.
fullmeans a reader that really parses the format accepts it, not merely that the extension matches. -
Checked against
The independent reader that opens every generated file before the format ships - a separate implementation, not our own code marking its own homework.
Every format also repeats to the byte: the same recipe and seed produce identical files on any machine, which is what makes a recipe safe to commit in place of the fixtures themselves.
Settings each format accepts
Most formats take settings of their own - image dimensions, JPEG quality, PDF page count, rows and
columns in a spreadsheet, how many entries go inside an archive. Set them with
--set key=value on the command line, or under properties: in a recipe.
tfg generate --format jpg --size 500kb --set width=1920 --set height=1080 --set quality=85
| Format | Setting | Accepts |
|---|---|---|
avif |
width |
1 - 16384 pixels |
height |
1 - 16384 pixels | |
quality |
1 - 100 | |
bmp |
width |
1 - 20000 pixels |
height |
1 - 20000 pixels | |
csv |
delimiter |
comma, pipe, semicolon, tab |
line_ending |
crlf, lf | |
header |
true or false | |
quote_style |
all, minimal, none | |
columns |
2 - 32768 columns | |
docx |
paragraphs |
1 - 50000 paragraphs |
eml |
body |
alternative, html, plain |
text_encoding |
7bit, 8bit, quoted-printable | |
headers |
ascii, encoded, utf8 | |
line_endings |
crlf, lf | |
attachments |
0 - 10000 | |
attachment_format |
the id of a format, as tfg formats lists them | |
attachment_size |
a size such as 2mb | |
filename_style |
both, content-type, rfc2047, rfc2231 | |
geojson |
geometry |
geometrycollection, linestring, mixed, multilinestring, multipoint, multipolygon, point, polygon |
formatting |
indented, minified, record-per-line | |
precision |
0 - 15 decimal places | |
altitude |
true or false | |
vertices |
3 - 1000000 points | |
holes |
0 - 100000 holes | |
winding |
reversed, rfc7946 | |
antimeridian |
true or false | |
unlocated |
all, none, some | |
ids |
mixed, none, number, string | |
bbox |
true or false | |
gif |
width |
1 - 20000 pixels |
height |
1 - 20000 pixels | |
frames |
1 - 60 | |
html |
structure |
document, fragment |
ico |
width |
1 - 256 pixels |
height |
1 - 256 pixels | |
embed |
bmp, png | |
jpg |
width |
1 - 20000 pixels |
height |
1 - 20000 pixels | |
quality |
1 - 100 | |
json |
formatting |
indented, minified, record-per-line |
jxl |
width |
1 - 16384 pixels |
height |
1 - 16384 pixels | |
quality |
1 - 100 | |
log |
entry_format |
apache-combined, apache-common, json-lines, nginx, plain, syslog |
timestamps |
advancing, fixed | |
rate |
1 - 1000000 entries per second | |
methods |
get, mixed, read | |
status_mix |
client-errors, realistic, server-errors, success | |
level_mix |
debug, errors, quiet, realistic | |
ip_version |
mixed, v4, v6 | |
line_ending |
crlf, lf | |
md |
encoding |
utf-16be, utf-16le, utf-8 |
bom |
true or false | |
mp4 |
width |
1 - 16384 pixels |
height |
1 - 16384 pixels | |
duration |
a length of time such as 10s | |
change_interval |
a length of time such as 10s | |
frame_rate |
1, 5, 10, 12, 15, 24, 25, 30, 48, 50, 60 | |
keyframe_interval |
a length of time such as 10s | |
quality |
1 - 100 | |
pdf |
pages |
1 - 5000 |
page_size |
a3, a4, a5, legal, letter, mixed | |
orientation |
landscape, mixed, portrait | |
rotate |
0, 90, 180, 270 | |
pdf_version |
1.4, 1.7 | |
title |
any text | |
author |
any text | |
subject |
any text | |
keywords |
any text | |
creator |
any text | |
producer |
any text | |
created |
a date such as 2024-02-29 or 2024-02-29T13:45:00+02:00, or none | |
modified |
a date such as 2024-02-29 or 2024-02-29T13:45:00+02:00, or none | |
png |
width |
1 - 20000 pixels |
height |
1 - 20000 pixels | |
pptx |
slides |
1 - 500 slides |
svg |
width |
1 - 20000 pixels |
height |
1 - 20000 pixels | |
targz |
entries |
0 - 10000 |
entry_format |
the id of a format, as tfg formats lists them | |
entry_size |
a size such as 2mb | |
compression |
best, default, fast, none | |
depth |
0 - 50 | |
directory_entries |
true or false | |
entry_mode |
000, 400, 444, 600, 644, 664, 666, 700, 755, 777 | |
entry_owner |
root, unset, user | |
tiff |
width |
1 - 20000 pixels |
height |
1 - 20000 pixels | |
txt |
encoding |
utf-16be, utf-16le, utf-8 |
bom |
true or false | |
wav |
sample_rate |
8000 - 192000 hertz |
bit_depth |
8, 16, 24, 32 | |
channels |
1 - 8 | |
content |
noise, silence, sweep, tone | |
webm |
width |
1 - 16384 pixels |
height |
1 - 16384 pixels | |
duration |
a length of time such as 10s | |
change_interval |
a length of time such as 10s | |
frame_rate |
1, 5, 10, 12, 15, 24, 25, 30, 48, 50, 60 | |
keyframe_interval |
a length of time such as 10s | |
quality |
1 - 100 | |
webp |
width |
1 - 16383 pixels |
height |
1 - 16383 pixels | |
xlsx |
rows |
1 - 200000 rows |
columns |
1 - 32768 columns | |
xml |
encoding |
utf-16be, utf-16le, utf-8 |
bom |
true or false | |
zip |
entries |
0 - 10000 |
entry_format |
the id of a format, as tfg formats lists them | |
entry_size |
a size such as 2mb | |
compression |
best, default, fast, none | |
depth |
0 - 50 | |
directory_entries |
true or false | |
password |
the password, in plain text | |
encryption |
aes-128, aes-192, aes-256, none, zipcrypto |
A value outside what a setting accepts is refused with a message naming the setting, the allowed range and what to use instead. An unknown setting is an error too, never a silent default - a typo accepted in silence gives a file with the wrong settings and an hour spent wondering why the test passes when it should not.
Run tfg formats <id> to see exactly what one format accepts on the build you have.
Archives hold real files
eml and targz and zip
can be filled with entries rather than left as an empty shell. A generated archive genuinely
contains the documents it claims to contain, so anything that unpacks it during a test finds real
files inside.
targets:
- id: bundle
format: zip
contains:
- format: txt
count: 200
size: 4kb