Resize a picture
postfjord_resize_mediaGenerates resized copies of a media library image in specified aspect ratios for social formats, returning new media IDs while keeping the original unchanged.
Instructions
Makes new pictures of other shapes from one picture in the media library, one new file per shape (like Magic Resize), and returns their mediaIds. The original never changes. Shapes: 1x1 (square), 4x5 (portrait feed), 9x16 (story and reel), 16x9, 1.91x1, 3x2, 2x3, 4x3; at most one of each in a call. You can call it right after postfjord_upload_media with the new id: it waits a few seconds for the picture to be ready. Each size is a shape alone ("9x16") for the automatic crop, where Postfjord picks the best part, or { aspect, mode, focus, zoom }: mode crop with focus { x, y } (0 to 1 from the top left of the original) on what must stay and zoom 1 to 4, or mode whole to show the whole picture on a soft blurred copy of itself. Use mode whole when a crop would cut off people (heads, hands, feet) or words in the picture (a poster, a menu, a quote). Check the result with postfjord_get_media (previews) before you use it. The new files count toward the plan's storage, and each plan makes a number of resized pictures a day; over it the call is refused. On a retry after a timeout or error, send the same idempotency_key: the first answer comes back and nothing is made or sent twice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sizes | Yes | The shapes to make. Common: ["1x1", "4x5", "9x16"]. | |
| mediaId | Yes | The picture to resize, from postfjord_list_media or postfjord_upload_media. | |
| idempotency_key | No | Your own id for this one action, for example post-20261006-launch. Make a new one for each new thing; send the same one again only when you retry. Left out, the exact same call within 10 minutes counts as a retry. |