getImageDimensions
Retrieve width, height, aspect ratio, and orientation (landscape, portrait, square) from JPG/PNG image URLs by parsing header bytes. Verifies image properties before assigning to feature image fields.
Instructions
Probe an image URL and return its dimensions + orientation. - Wrapper-native synthetic tool. Range-GETs the first 64KB of an image URL and parses JPG/PNG header bytes to return width, height, format, aspect_ratio, and orientation (landscape | portrait | square). Does NOT proxy to BD. Used by content-creation skills to verify image orientation before committing to a feature-image field (post_image, cover_photo, hero_image).
Caller contract: filter candidate URLs to .jpg / .jpeg / .png BEFORE calling. WebP / GIF / AVIF are unsupported — the parser returns { status: "error", message: "unsupported image format..." } as a defense-in-depth fallback, but callers must not rely on it; skip non-JPG/PNG extensions outright per Rule: Image dimensions. Any error response (404, timeout, parse fail, unsupported format) means drop the candidate and pick another.
See also: Rule: Image dimensions, Rule: Image dedup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Bare canonical image URL (e.g. `https://images.pexels.com/photos/<id>/pexels-photo-<id>.jpeg`). Must respond with HTTP 200/206 to a Range request for the first 64KB. |