info
Inspect an image without decoding it.
Report format, dimensions, size and metadata facts for one or more images.
info <inputs...> # inspect(); no decode, no codec load
info runs inspect() on the raw bytes — magic-byte sniffing and header parsing only. It never
decodes a pixel and never loads a codec, so it’s cheap even on a HEIC file the tool can’t compress
without libheif.
Flags
info takes no command-specific flags. It also rejects three of the global flags that every
other command accepts, rather than silently ignoring them:
| Flag | Why it’s rejected |
|---|---|
--out <dir> |
info writes no output file at all — there is nowhere for --out to point. |
--in-place |
same reason: nothing is ever written, in place or otherwise. |
--dry-run |
info’s entire output is a dry run in spirit (nothing is written either way) — accepting the flag and doing nothing differently would make it look honored while doing nothing. |
This is a deliberate design choice, not an oversight: a usage mistake exits 2 with a sentence explaining why, the same standard every other flag in this tool holds to, rather than a flag that looks like it does something and silently doesn’t.
Fields reported
| Field | Notes |
|---|---|
format |
jpeg, png, webp, avif, or heic — info is the only command that can report heic, since it’s the one command that never has to produce an output format. |
width, height |
pixel dimensions as decoded, before EXIF orientation is applied. |
bytes |
size of the original file. |
orientation |
EXIF orientation tag (1–8), when present. |
hasAlpha, isAnimated |
when known. |
hasExif, hasGps, hasIptc, hasXmp |
metadata-presence facts — what strip would remove. |
Any field inspect() didn’t determine is omitted, never printed as a fabricated false or
undefined — both the human table and --json output follow this rule.
Examples
imagekbreducer info photo.jpg
photo.jpg
format jpeg
dimensions 800x600
size 239.4 KB
orientation 6
exif true
gps false
imagekbreducer info *.jpg --json | jq '.results[] | {input, hasGps}'
What can go wrong
| Exit | When |
|---|---|
| 2 | --out, --in-place, or --dry-run passed |
| 3 | an input doesn’t exist, or a glob matched nothing |
| 20 | unsupported-format — not a jpeg/png/webp/avif/heic source |
| 21 | decode-failed — a truncated, corrupt, or empty (0-byte) file |
| 22 | input-too-large — checked against stat().size before the file is even read |
| 23 | dimension-exceeded — header dimensions exceed the configured pixel ceiling |
info never produces exit 4 (nothing is ever written) or 10–13 (there’s no search — see
Exit codes).