26 Dateiformate, jedes in exakter Größe erzeugt
Jedes davon ist eine echte Datei dieses Formats. Sie öffnet sich in der Software, zu der sie gehört, und hat genau die Byte-Zahl, die du verlangt hast. Keines davon besteht aus aufgefüllten Nullen mit einer angeklebten Endung.
| Format | Name | Endung | Kleinste Datei | Vollständigkeit | Geprüft mit |
|---|---|---|---|---|---|
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 |
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 | nicht zutreffend |
md |
Markdown | .md |
0 | full | nicht zutreffend |
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 | nicht zutreffend |
wav |
Waveform Audio | .wav |
98 | full | ffprobe |
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 |
Was die Spalten bedeuten
-
Kleinste Datei
Die wenigsten Bytes, die dieses Tool für das Format akzeptiert, einschließlich des Labels, das es in die Datei schreibt. Verlangst du weniger, bekommst du einen Fehler, der die Untergrenze und ihren Grund nennt, nie eine Datei in der falschen Größe.
-
Vollständigkeit
Wie vollständig die Datei ist.
fullheißt, dass ein Leser, der das Format wirklich parst, sie akzeptiert, nicht nur, dass die Endung passt. -
Geprüft mit
Der unabhängige Leser, der jede erzeugte Datei öffnet, bevor das Format ausgeliefert wird - eine eigene Implementierung, nicht unser eigener Code, der seine Hausaufgaben selbst korrigiert.
Jedes Format wiederholt sich außerdem bis aufs Byte: Dasselbe Rezept und derselbe Seed erzeugen auf jedem Rechner identische Dateien, und genau das macht ein Rezept sicher einzuchecken statt der Fixtures selbst.
Einstellungen, die jedes Format kennt
Die meisten Formate haben eigene Einstellungen - Bildmaße, JPEG-Qualität, PDF-Seitenzahl, Zeilen und
Spalten in einer Tabelle, wie viele Einträge in ein Archiv kommen. Setze sie mit --set
key=value auf der Kommandozeile oder unter properties: in einem Rezept.
tfg generate --format jpg --size 500kb --set width=1920 --set height=1080 --set quality=85
| Format | Einstellung | Erlaubt |
|---|---|---|
avif |
width |
1 - 16384 Pixel |
height |
1 - 16384 Pixel | |
quality |
1 - 100 | |
bmp |
width |
1 - 20000 Pixel |
height |
1 - 20000 Pixel | |
csv |
delimiter |
comma, pipe, semicolon, tab |
line_ending |
crlf, lf | |
header |
wahr oder falsch | |
quote_style |
all, minimal, none | |
columns |
2 - 32768 Spalten | |
docx |
paragraphs |
1 - 50000 Absätze |
gif |
width |
1 - 20000 Pixel |
height |
1 - 20000 Pixel | |
frames |
1 - 60 | |
html |
structure |
document, fragment |
ico |
width |
1 - 256 Pixel |
height |
1 - 256 Pixel | |
embed |
bmp, png | |
jpg |
width |
1 - 20000 Pixel |
height |
1 - 20000 Pixel | |
quality |
1 - 100 | |
json |
formatting |
indented, minified, record-per-line |
jxl |
width |
1 - 16384 Pixel |
height |
1 - 16384 Pixel | |
quality |
1 - 100 | |
log |
entry_format |
apache-combined, apache-common, json-lines, nginx, plain, syslog |
timestamps |
advancing, fixed | |
rate |
1 - 1000000 Einträge pro Sekunde | |
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 |
wahr oder falsch | |
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 |
beliebiger Text | |
author |
beliebiger Text | |
subject |
beliebiger Text | |
keywords |
beliebiger Text | |
creator |
beliebiger Text | |
producer |
beliebiger Text | |
created |
ein Datum wie 2024-02-29 oder 2024-02-29T13:45:00+02:00, oder none | |
modified |
ein Datum wie 2024-02-29 oder 2024-02-29T13:45:00+02:00, oder none | |
png |
width |
1 - 20000 Pixel |
height |
1 - 20000 Pixel | |
pptx |
slides |
1 - 500 Folien |
svg |
width |
1 - 20000 Pixel |
height |
1 - 20000 Pixel | |
targz |
entries |
0 - 10000 |
entry_format |
die ID eines Formats, wie tfg formats sie auflistet | |
entry_size |
eine Größe wie 2mb | |
compression |
best, default, fast, none | |
depth |
0 - 50 | |
directory_entries |
wahr oder falsch | |
entry_mode |
000, 400, 444, 600, 644, 664, 666, 700, 755, 777 | |
entry_owner |
root, unset, user | |
tiff |
width |
1 - 20000 Pixel |
height |
1 - 20000 Pixel | |
txt |
encoding |
utf-16be, utf-16le, utf-8 |
bom |
wahr oder falsch | |
wav |
sample_rate |
8000 - 192000 Hertz |
bit_depth |
8, 16, 24, 32 | |
channels |
1 - 8 | |
content |
noise, silence, sweep, tone | |
webp |
width |
1 - 16383 Pixel |
height |
1 - 16383 Pixel | |
xlsx |
rows |
1 - 200000 Zeilen |
columns |
1 - 32768 Spalten | |
xml |
encoding |
utf-16be, utf-16le, utf-8 |
bom |
wahr oder falsch | |
zip |
entries |
0 - 10000 |
entry_format |
die ID eines Formats, wie tfg formats sie auflistet | |
entry_size |
eine Größe wie 2mb | |
compression |
best, default, fast, none | |
depth |
0 - 50 | |
directory_entries |
wahr oder falsch | |
password |
das Passwort im Klartext | |
encryption |
aes-128, aes-192, aes-256, none, zipcrypto |
Ein Wert außerhalb dessen, was eine Einstellung zulässt, wird mit einer Meldung abgewiesen, die die Einstellung, den erlaubten Bereich und eine Alternative nennt. Eine unbekannte Einstellung ist ebenfalls ein Fehler, nie ein stiller Standardwert - ein stillschweigend akzeptierter Tippfehler ergibt eine Datei mit den falschen Einstellungen und eine Stunde Rätselraten, warum der Test besteht, obwohl er es nicht sollte.
Mit tfg formats <id> siehst du genau, was ein Format in dem Build akzeptiert, den
du hast.
Archive enthalten echte Dateien
targz und zip
lassen sich mit Einträgen füllen, statt als leere Hülle zu bleiben. Ein erzeugtes Archiv enthält
wirklich die Dokumente, die es zu enthalten vorgibt, sodass alles, was es während eines Tests
entpackt, echte Dateien darin findet.
targets:
- id: bundle
format: zip
contains:
- format: txt
count: 200
size: 4kb