2026 OpenClaw in Practice: Watch Design Export Folders on a Remote Mac, Batch-Correct PNG EXIF Orientation, and Lossless Auto-Rotate with Repeatable Commands

Who this is for: design-ops and automation owners who export PNGs from Figma, Sketch, browsers, or photo pipelines and see wrong preview orientation in some viewers while others look fine—usually an EXIF Orientation tag (often in the PNG eXIf chunk) that was never normalized. On a remote Mac, OpenClaw can wrap the same shell steps every time: watch the inbox, read the tag, apply a lossless physical rotation when needed, reset or strip orientation metadata per policy, then publish under a deterministic name. Baseline install steps live in the OpenClaw install guide (all platforms); retry and log patterns pair with PNG watch folders: retries & log archive and PNG CLI chain & retry on remote Mac.

Table of Contents

Use this list as a crawl and ops map—each target extends this tutorial without repeating install steps.

OpenClaw & Gateway: minimal deployment

Keep the remote Mac worker boring: one service user, one pinned OpenClaw version, and a Gateway that answers /health on 127.0.0.1 only. Follow the all-platform install guide, put API tokens in ~/.config/openclaw.env (mode 600), and confirm curl -sS http://127.0.0.1:<port>/health succeeds from both GUI login and ssh user@host bash -lc '...'—non-interactive shells often miss PATH entries for magick and exiftool.

Minimal checklist:

  • Process ownership: run the watcher and OpenClaw under the same UID that owns inbox/ and out/.
  • TCC: if Terminal or a custom binary is blocked from reading certain folders, add the exact binary under System Settings → Privacy & Security → Full Disk Access.
  • Firewall: do not expose the Gateway to WAN; use SSH port forwarding if you must trigger jobs from another host.
  • Skill boundary: implement EXIF and rotate steps as shell or Python invoked from an OpenClaw skill so you can unit-test the commands without the full agent loop.
Smoke test dependencies: which magick exiftool, magick -version, and exiftool -ver from the same wrapper script the watcher calls.

Folder watch strategy

Design tools often write partial files first. Point exports at a dedicated inbox such as ~/png_jobs/design_export/inbox on local SSD—not iCloud Desktop or SMB—to avoid half-written PNGs and sync latency. Mirror the directory layout from watch folder → multi-size PNG sets: separate inbox, work, out, failed, logs.

Watcher rules that survive real designers:

  1. Filter to *.png; ignore .DS_Store, *.tmp, *.crdownload.
  2. Stable size: two identical stat results 500 ms apart before enqueue.
  3. Debounce: 1–3 s coalescing for fswatch; or launchd WatchPaths with a short delay script.
  4. Quiet window for bursts: if many files land at once, wait until no new PNGs for 30–60 s, then drain sorted—same pattern as the ICC watch & rename pipeline.
  5. Single-flight: one worker process so concurrent exports serialize deterministically.

Reproducible watch trigger (fswatch + coalesce): install via Homebrew (brew install fswatch), point at your inbox, then call the same zsh loop your OpenClaw skill uses. The inner sleep collapses burst events; replace the script path with your worker.

INBOX=~/png_jobs/design_export/inbox
fswatch -o "$INBOX" | while read -r; do
  sleep 2
  /usr/local/bin/your_png_exif_rotate_worker.zsh
done

launchd alternative: use WatchPaths on the inbox folder and a tiny wrapper that sleeps 1–3 s before invoking the worker—document the plist path in your repo so another operator can diff it.

EXIF Orientation processing flow

EXIF Orientation values 1–8 describe how viewers should rotate or mirror decoded pixels. A PNG may look correct in one app that applies the tag automatically and wrong in a pipeline that reads raw bitmap bytes. Your automation should read the tag first, then decide: pass-through, rotate, or quarantine for human review.

Read orientation (numeric):

exiftool -n -Orientation -s3 "$PNG"

If the output is empty or 1, the file is usually already “upright” for pixel data; still cross-check width/height against your design spec. Values 28 imply a transform—most product pipelines care about 3 (180°), 6 (90° CW), and 8 (90° CCW), but mirrored values need an explicit policy (some teams reject mirrored assets outright).

Policy table (suggested):

Orientation tag Action Notes
Missing or 1 No rotation; optional metadata strip later Do not assume camera-style pipelines—UI PNGs often have no EXIF.
3, 6, 8 magick -auto-orient then normalize tag Produces physically upright pixels for dumb consumers.
2, 4, 5, 7 (mirrored) Quarantine or explicit flop+rotate script Brand assets rarely intend mirroring—flag for review.

After rotation, either set Orientation to 1 with exiftool -Orientation=1 -overwrite_original or strip EXIF per your PNG metadata & ICC runbook so downstream tools do not double-apply.

Batch lossless rotation & naming archive

Lossless here means preserving decoded image content without unintended resampling: rotation by 90°/180° on PNG is typically handled without changing color depth; however, re-encoding may still change compressed byte size. Validate on a golden set if you promise bit-identical delivery—see lossless recompress notes.

Single-file auto-orient (ImageMagick 7):

magick "$IN" -auto-orient "$OUT"
# then normalize EXIF Orientation so viewers agree:
exiftool -overwrite_original -Orientation=1 "$OUT"

Batch loop (zsh) sketch—run inside OpenClaw skill or LaunchAgent:

inbox=~/png_jobs/design_export/inbox
out_root=~/png_jobs/design_export/out/$(date +%F)
mkdir -p "$out_root"
for f in "$inbox"/*.png; do
  [ -f "$f" ] || continue
  ori=$(exiftool -n -Orientation -s3 "$f" 2>/dev/null || echo "")
  [[ -z "$ori" || "$ori" == "1" ]] && cp -p "$f" "$out_root/$(basename "$f")" && continue
  base=$(basename "$f" .png)
  magick "$f" -auto-orient "$out_root/${base}_rot_v01.png"
  exiftool -overwrite_original -Orientation=1 "$out_root/${base}_rot_v01.png"
done

Align final names with PNG auto-naming & batch validation: include _rot_v01 or a semver only when the worker changed pixels. Append one JSONL line per file with sha256_before, sha256_after, orientation_in, and duration ms.

Optional: after rotation, run your existing ICC checks from the ICC watch pipeline—rotation must not invalidate embedded profiles, but a bad tool chain might strip them; fail closed to quarantine/ if sRGB embed disappears.

Common errors FAQ

exiftool reports “Unknown file type” for a PNG I can open in Preview.

The file may be zero bytes, renamed JPEG, or on a volume the sandboxed binary cannot read. Verify magic bytes with xxd -l 8 (expect 89 50 4E 47) and run exiftool as the same user as the watcher.

-auto-orient did nothing but the preview is still sideways.

Some tools store orientation only in sidecar metadata your viewer ignores, or the image was exported without EXIF but with non-square pixels—check intrinsic size in the design file. Do not rotate unless the tag or a human confirms it.

Gateway 401 from the skill—rotation never runs.

Token scope or env not loaded in launchd: use launchctl print user/<uid>, inline EnvironmentVariables in the plist, or source openclaw.env inside the wrapper script.

File grew or shrank after magick—is that a failure?

Not necessarily; PNG recompression changes bytes. Compare decoded pixels or enforce a perceptual hash policy. For marketing compliance, document whether byte-identical output is required.

Operation not permitted on inbox—watcher never sees files.

macOS TCC blocked the binary or SSH session from the folder. Run ls -leO on the inbox path, confirm the worker UID matches ownership, and add Terminal (or your signed helper) under Full Disk Access if reads still fail.

Summary: treat EXIF Orientation as data you read before you transform pixels; use debounced watches and stable-size gates on a remote Mac inbox; apply magick -auto-orient plus explicit Orientation=1 when you physically rotate; archive under dated folders and JSONL so the same OpenClaw skill works on the next project. When you need always-on Apple Silicon for asset automation—without tying up a laptop—browse rental and purchase options on MacPng (no account required to compare plans), use nodes & pricing to size RAM and SSD, and follow the SSH / VNC setup guide to attach your worker. More pipelines: Tech Insights index.

Public site pages only — no login

Run OpenClaw PNG EXIF & rotate pipelines on a dedicated remote Mac

Rent / Buy now View nodes & pricing SSH / VNC guide

Related: OpenClaw install, watch & retry archive, ICC & lossless recompress.

OpenClaw & remote Mac 2026 EXIF watch · lossless rotate · archive
Rent now