# Image size checker

Check X and LinkedIn post photos, banners and profile photos with the free checker's own geometry and drawings.
Geometry is not a visual preview, and neither is proof that a platform accepted or published a file.

## Dimensions only

`checkImageSizes` is public, stateless and read-only: `POST https://app.flaghand.com/api/v1/tools/check-image-sizes`.
It accepts dimensions, not image files or URLs. Nothing is saved or fetched.

```sh
flaghand tools check-image-sizes --platform x --use profile --view phone \
  --header '{"w":1500,"h":500}' --photo '{"w":800,"h":600}' --json
flaghand tools check-image-sizes --platform linkedin --view phone --li-mode portrait \
  --photos '[{"w":1600,"h":900},{"w":1080,"h":1920}]' --json
```

In MCP, load `getOperation {"operation_id":"checkImageSizes"}`, then call it through `callReadOperation`.
The ordinary remote MCP sign-in still applies even though the HTTP utility is public.

The report includes:

- `layout`: the native frame/banner/photo placement or carousel layout, including the profile ring;
- `items`: dimensions and aspect, the displayed `box`, centered `kept` rectangle, per-side/per-end `cut` fractions,
  circle mask, banner `under` occlusion circle, and sharp-screen softness diagnostic;
- `words`: the same crop, file-size and softness explanations as the page;
- `recommended`: the platform sizes and file-size advice used by the page.

`kept` and `under` coordinates are in **source-image pixels**, not preview pixels. `cut` rounds losses smaller than
half a percent per side to whole, as the page does. The occlusion circle represents the photo over the banner;
it is not a promise that all text outside it is safe from every platform control. The profile ring remains part of
`layout.photo`, separate from that circle.

`use` defaults to `post`; `view` to `desktop`; `li_mode` to `landscape` (wide, rather than `portrait`/tall).
The browser page chooses its initial view from its viewport; machine calls use an explicit, reproducible desktop
fallback. Omitted images use the page's samples: a 1600 × 900 post, 1500 × 500 banner and 400 × 400 profile photo.
Post photos stay in order and accept up to four, the existing X rule. LinkedIn single-image portraits are shown
whole with side bars, not cropped. Multi-photo LinkedIn phone layouts **have not been measured**: a phone request
returns `effective_view: "desktop"` and says so. LinkedIn's wide/tall choice is selectable, not predicted. X's
interpolated carousel geometry retains its renderer's `layout.exact` flag; exact reuse of that renderer is not a
claim that every native platform layout is measured.

## Native PNGs and crop outputs on your machine

These use Chrome, Chromium, Edge or Brave installed on your machine, headless with a fresh disposable profile.
No API or account is needed. Image paths are local; the rendering page loads only its packaged files.

```sh
flaghand tools render-image-checker --platform x --view phone --theme dark \
  --photos first.png --photos second.png --out preview.png --json
flaghand tools render-image-checker --platform linkedin --use profile \
  --header banner.png --photo avatar.png --out profile.png --json
```

The preview PNG uses the same native frame as the browser checker. JSON also contains `maps` (the page's small,
dimmed crop/occlusion overlays at 1×) and `crops` (the kept image resized to its displayed box, profile-photo corners
transparent). Each has `label`, `mime_type`, `base64`, `width` and `height`. Crop PNG sizes round fractional CSS box
sizes to whole pixels; the geometry report retains the original fractions. Very long preview/crop PNGs scale down
to fit the browser's canvas area and axis constraints without changing the geometry or refusing an image. For an extremely narrow carousel image
whose borders leave no visible content, its box/kept width is zero and the crop is a transparent one-pixel-wide PNG
marked `empty: true`, not a negative crop or an input refusal. Map PNGs always have positive backing dimensions.
The native PNG includes the profile ring
and frame; an individual crop does not. The frame follows the machine's fonts, just as LinkedIn follows the viewer's.

The local stdio MCP tool `renderImageChecker` takes the same fields, with `photos` as a path array. It returns the
native preview, maps and crops as image content and the report as structured content. Each map/crop's structured
`content_index` identifies its image block; base64 is not duplicated in the metadata or text. Use `browser` or the CLI's
`--browser PATH` if the browser cannot be found automatically (one whose policy turns remote debugging off is passed over).

## Hosted rendering

`renderHostedImageChecker` is `POST https://app.flaghand.com/api/v1/workspaces/{workspace}/tools/render-image-checker`:
read scope in a signed-in workspace, without creating media, drafts or jobs. It accepts the same
`platform`, `use`, `view`, `theme` and `li_mode`, with images **by value**, not paths or URLs:

```json
{"platform":"linkedin","use":"profile","view":"phone","theme":"dark","header":{"base64":"PNG_JPEG_OR_OTHER_BROWSER_IMAGE_BYTES","content_type":"image/png","name":"banner.png"},"photo":{"base64":"IMAGE_BYTES","content_type":"image/png","name":"avatar.png"}}
```

`photos` is an array of those image objects for a post. `base64` is standard base64 without a data-URL prefix.
Unlike the browser page and the local renderer, **hosted rendering sends the supplied images to the server and its
hosted browser**. The response carries the native PNG in `base64` with `mime_type`, dimensions, geometry, maps and
crops. The remote MCP exposes it through `getOperation` and `callReadOperation`; generated CLI:

```sh
flaghand tools render-hosted-image-checker -d @checker-input.json --json
```

The free browser checker continues to handle dropped/chosen/pasted images locally. None of these tools reads an
account from X or LinkedIn, changes a platform profile, or grants posting authority.
