Test cases / pdf

deft pdf extract-images

Save embedded pictures, unchanged

2 runs on real files, 3 tests on generated files, not shown. 0 failed.

Fixed cases

Generated files, compared with ground truth by tools other than deft.

a one-ink image comes out as grayPassed

deft pdf extract-images manual.pdf --pages 1 -o out/

Input

manual.pdf 504.2 KB · 16 pages
Page 1Page 2Page 3

Output

out/manual-p001-001.png 1.5 KB · 68x59
out/manual-p001-001.png
What it printed
ok pdf.extract-images manual.pdf -> out/manual-p001-001.png  1 images  0.00s
Automatic checks (2)
  • count_files: count = 1, glob = "out/*.png"
  • python: code = "import glob; from PIL import Image; i = Image.open(glob.glob('out/*.png')[0]); assert i.mode == 'L' and i.size == (68, 59), (i.mode, i.size)"

Real-file tasks

Real files and a plain-language job, from the agent benchmark. These are the reference answers, not an agent run.

Pull out the picturesPassed

Save every picture embedded in paper.pdf into a folder called pictures.

deft pdf extract-images paper.pdf -o pictures/

Input

paper.pdf 992.5 KB · 14 pages
Page 1Page 2Page 3
Automatic checks (1)
  • count_files: glob = "pictures/*", min = 10