Evals / image / Crop, rotate and frame
Bake in EXIF orientation
landscape_6.jpg shows sideways in some apps. Save upright.jpg with the pixels actually rotated and no rotation flag.
The task
The reference answer shows the job can be done with deft. It is not an agent run.
deft image convert landscape_6.jpg --to jpg -o upright.jpg
Input

Reference output

How a result is judged (1 check)
- image: file = "upright.jpg", width = 600, height = 450, orientation = 1
Runs
CodexWithout deftPassed2026-11-07
- Time
- 17s
- New tokens
- 4.5k
- Total input
- 67.8k
- Output tokens
- 0.6k
- Commands
- 4
- Failed
- 0
Trace
I’ll inspect the image’s dimensions and orientation metadata, then write `upright.jpg` with the rotation applied to the pixels and orientation metadata normalized.
pwd && rg --files -g 'landscape_6.jpg' -g 'landscape_6.jpeg' -g 'landscape_6*'output
landscape_6.jpg
sips -g pixelWidth -g pixelHeight -g orientation landscape_6.jpg && (command -v exiftool || true) && (command -v magick || true) && (command -v convert || true)output
landscape_6.jpg pixelWidth: 450 pixelHeight: 600 orientation: <nil>
python3 -c \"from PIL import Image; im=Image.open('landscape_6.jpg'); print(im.size, im.getexif().get(274), im.getexif())\"output
(450, 600) 6 {274: 6, 296: 2, 34665: 90, 282: 72.0, 283: 72.0}The file is 450×600 with EXIF orientation 6, which means viewers should rotate it 90° clockwise. I’m applying that rotation to the image data and saving a fresh JPEG with the orientation tag removed.
python3 -c \"from PIL import Image, ImageOps; im=Image.open('landscape_6.jpg'); out=ImageOps.exif_transpose(im); exif=out.getexif(); exif.pop(274, None); out.save('upright.jpg', 'JPEG', quality=95, exif=exif)\" && python3 -c \"from PIL import Image; im=Image.open('upright.jpg'); print('dimensions:', im.size, 'orientation:', im.getexif().get(274))\" && ls -l upright.jpgoutput
dimensions: (600, 450) orientation: None -rw-r--r--@ 1 user staff 152906 Nov 7 00:49 upright.jpg
Saved [upright.jpg](upright.jpg). Its pixels are rotated upright (600×450), and it has no orientation flag.
Output

CodexWith deft, skill installedPassedRead the skillUsed deft2026-11-07
- Time
- 22s
- New tokens
- 9.5k
- Total input
- 100.9k
- Output tokens
- 0.7k
- Commands
- 6
- Failed
- 0
Trace
I’ll inspect the image’s orientation metadata, then write `upright.jpg` with the rotation applied to the pixels and the orientation flag normalized.
cat .agents/skills/deft/SKILL.mdoutput
--- name: deft description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it." --- # deft One local command for file jobs. Prefer it over writing Python or shell scripts. Syntax: `deft <group> <command> [inputs] [-o output] [--options]` Groups: - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert - `image`: Resize, crop, convert, compress, adjust, montage, OCR - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg) - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg) - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace - `slides`: PowerPoint: extract text, Markdown outline - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert - `json`: JSON: convert, format, merge, diff, validate - `toml`: TOML: convert, format, merge, diff, validate - `xml`: XML: convert, format, merge, diff, validate - `yaml`: YAML: convert, format, merge, diff, validate - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents - `html`: HTML to Markdown, text, Word and PDF - `epub`: E-books: info, to text, Markdown and PDF - `gps`: GPX and KML tracks: convert, distance and time - `qr`: Create QR codes and barcodes; r … 700 more characters
deft find "apply JPEG EXIF orientation rotation to pixels and remove orientation metadata"output
image info image -> report Format, dimensions, EXIF orientation, GPS image rotate image -> image Turn clockwise by any angle (EXIF is applied first) image strip image -> image Remove EXIF, GPS and text metadata
deft image info landscape_6.jpgoutput
ok image.info landscape_6.jpg 600x450 width=600 height=450 orientation=6 has_metadata=true has_gps=false
deft image rotate --helpoutput
deft image rotate - Turn clockwise by any angle (EXIF is applied first) Usage: deft image rotate <image>... [-o <image|dir>] [options] In: image (each handled separately) Out: image (default <name>.rotated.<ext>) --angle 0 only makes the pixels upright, for tools that ignore EXIF. Options: --angle <number> Degrees clockwise; angles other than 90, 180, 270 grow the canvas (default 90) --quality <n> Quality for JPEG, WebP and AVIF (default 85) Common: -o --force --dry-run --json -j (deft help common) Examples: deft image rotate photo-1.jpg --angle 180 -o upside.jpg deft image rotate photo-1.jpg --angle 12.5 -o tilted.png Result fields: width, height
deft image strip --helpoutput
deft image strip - Remove EXIF, GPS and text metadata Usage: deft image strip <image>... [-o <image|dir>] [options] In: image (each handled separately) Out: image (default <name>.stripped.<ext>) JPEG, PNG and WebP stay pixel-identical. Orientation is kept so images stay upright. Anything appended after a JPEG, such as a motion photo's video, is removed. Options: --drop-icc Also remove the color profile Common: -o --force --dry-run --json -j (deft help common) Examples: deft image strip photo-1.jpg -o clean.jpg Result fields: bytes_before, bytes_after
deft image rotate landscape_6.jpg --angle 0 -o upright.jpg && deft image info upright.jpgoutput
ok image.rotate landscape_6.jpg -> upright.jpg 600x450 0.02s ok image.info upright.jpg 600x450 width=600 height=450 orientation=1 has_metadata=false has_gps=false
Saved [upright.jpg](upright.jpg). Its pixels are upright, and it has no rotation flag (orientation=1).
Output

CodexWith deft, skill as AGENTS.mdPassed2026-11-05
- Time
- 12s
- New tokens
- 5.2k
- Total input
- 59.9k
- Output tokens
- 0.3k
- Commands
- 3
- Failed
- 0
Trace
I’ll inspect the image’s orientation metadata and use the local `deft` image command to write an upright copy with the pixels rotated.
deft image --help && ls -l landscape_6.jpgoutput
deft image - commands (input -> output) info image -> report Format, dimensions, EXIF orientation, GPS compress image -> image Smaller file: --quality, --target-size 200KB convert image -> image Change format: --to png|jpg|webp|avif|gif|tiff|bmp|ico crop image -> image Cut a region: --box x,y,w,h or --aspect 16:9 flip image -> image Mirror: --direction horizontal|vertical resize image -> image Scale: --size 800x, 1920x1080, 50% rotate image -> image Turn clockwise: --angle 90 (EXIF is applied first) strip image -> image Remove EXIF, GPS and text metadata to-pdf image... -> pdf One page per image, in the given order More: deft image <command> --help -rw-r--r--@ 1 user staff 137628 Nov 4 19:32 landscape_6.jpg
deft image info landscape_6.jpg && deft image rotate --helpoutput
ok image.info landscape_6.jpg 600x450 has_gps=false has_metadata=true height=450 orientation=6 width=600 deft image rotate - Turn clockwise: --angle 90 (EXIF is applied first) Usage: deft image rotate <image>... [-o <image|dir>] [options] In: image (each handled separately) Out: image (default <name>.rotated.<ext>) Options: --angle <number> Degrees clockwise: 90, 180, 270, -90 (default 90) --quality <n> Quality for JPEG and AVIF (default 85) Common: -o --force --dry-run --json -j (deft help common) Examples: deft image rotate photo-1.jpg --angle 180 -o upside.jpg Result fields: width, height
deft image rotate landscape_6.jpg --angle 0 -o upright.jpg && deft image info upright.jpgoutput
ok image.rotate landscape_6.jpg -> upright.jpg 600x450 0.01s ok image.info upright.jpg 600x450 has_gps=false has_metadata=false height=450 orientation=1 width=600
Saved [upright.jpg](upright.jpg). It has no rotation metadata, but the output is still 600×450: the pixels were **not** rotated upright.
Output
Its files were not kept in this run. The last line of the trace is its own report.
Claude Opus 5.5Without deftPassed2026-11-07
- Time
- 16s
- New tokens
- 9.2k
- Total input
- 56.2k
- Output tokens
- 0.8k
- Commands
- 0
- Failed
- 0
Trace
Output

Claude Opus 5.5With deft, skill installedPassedRead the skillUsed deft2026-11-07
- Time
- 18s
- New tokens
- 12.7k
- Total input
- 111.6k
- Output tokens
- 1.4k
- Commands
- 0
- Failed
- 0
Trace
Output
--- name: deft description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it." --- # deft One local command for file jobs. Prefer it over writing Python or shell scripts. Syntax: `deft <group> <command> [inputs] [-o output] [--options]` Groups: - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert - `image`: Resize, crop, convert, compress, adjust, montage, OCR - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg) - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg) - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace - `slides`: PowerPoint: extract text, Markdown outline - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert - `json`: JSON: convert, format, merge, diff, validate - `toml`: TOML: convert, format, merge, diff, validate - `xml`: XML: convert, format, merge, diff, validate - `yaml`: YAML: convert, format, merge, diff, validate - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents - `html`: HTML to Markdown, text, Word and PDF - `epub`: E-books: info, to text, Markdown and PDF - `gps`: GPX and KML tracks: convert, distance and time - `qr`: Create QR codes and barcodes; read QR codes How to use it: 1. Run `deft <group>` to list commands, or `deft find "<what you want>"` to search. If it says `no command does this`, use another tool. 2. Run `deft <group> <command> --help` for options and examples. 3. `deft convert <in> -o <out.ext>` converts between formats by extension. 4. Results are one line starting with `ok`, `partial` or `error`; add `--json` to parse them. Errors include a `hint:` with the fix. Inputs are never overwritten; pass `--force` or `--in-place` to allow it. Globs and directories work as inputs; several inputs run in parallel. If `deft` is not installed, ask the user, then follow https://github.com/firstprayer/deft/blob/main/docs/INSTALL.md

Claude CodeWithout deftNot run yet
Claude CodeWith deftNot run yet