Apps / Orientation Sorter
Orientation Sorter v1.0.0
Sort a folder of images into portrait/, landscape/ and square/ subfolders by their real pixel aspect ratio (Pillow, not the filename). Every sort previews as a dry-run first and can be undone.
The omniscient:// link needs a protocol handler on your machine, which is not built yet. Until then it does nothing — use the commands below.
Actions
Jump to:
sortundo
Sort by orientation
sort
Destructive
Move every image in a folder into a portrait/, landscape/ or square/ subfolder based on its width and height. Use --dry-run to preview without moving anything.
Inputs
Name Type Required / default Values and notes
folder
path
required
square_tolerance
float
optional, default 1.0
on_conflict
enum
optional, default rename
renameskipoverwrite
Outputs
Name Type Notes
moved
int
skipped
int
counts
json
changes
json
Undo last sort
undo
Destructive
Reverse the most recent sort in a folder, using the journal Orientation Sorter keeps.
Inputs
Name Type Required / default Values and notes
folder
path
required
Outputs
Name Type Notes
restored
int
changes
json
Requires
Python >=3.10
Packages Pillow
Models none
Use it
sort
undo
Sort by orientation
Command line
shell Copy
python app.py --action sort --params '{"folder": "D:/path/to/folder"}'
# preview first - destructive action, nothing is changed:
python app.py --action sort --params '{"folder": "D:/path/to/folder"}' --dry-run
Run from the app’s own folder. Single quotes work in bash and PowerShell; in cmd.exe use double quotes and escape the inner ones.
MCP tool
mcp Copy
run_action("portrait-sorter", "sort", {"folder": "D:/path/to/folder"})
# preview first:
run_action("portrait-sorter", "sort", {"folder": "D:/path/to/folder"}, dry_run=true)
Workflow node
json Copy
{
"id": "n0",
"app": "portrait-sorter",
"action": "sort",
"params": {
"folder": "D:/path/to/folder"
},
"inputs": {}
}
Undo last sort
Command line
shell Copy
python app.py --action undo --params '{"folder": "D:/path/to/folder"}'
# preview first - destructive action, nothing is changed:
python app.py --action undo --params '{"folder": "D:/path/to/folder"}' --dry-run
Run from the app’s own folder. Single quotes work in bash and PowerShell; in cmd.exe use double quotes and escape the inner ones.
MCP tool
mcp Copy
run_action("portrait-sorter", "undo", {"folder": "D:/path/to/folder"})
# preview first:
run_action("portrait-sorter", "undo", {"folder": "D:/path/to/folder"}, dry_run=true)
Workflow node
json Copy
{
"id": "n0",
"app": "portrait-sorter",
"action": "undo",
"params": {
"folder": "D:/path/to/folder"
},
"inputs": {}
}
Example prompts
Things you can say to Claude, Cursor or Codex once the MCP server is registered.
sort the images in D:/camera-roll into portrait, landscape and square folders, preview first sort D:/renders by orientation and skip any name that already exists undo the last orientation sort on D:/camera-roll