Edit Image


Crops, rotates, flips or resizes an image, the way Media > Edit Image does. Crop by shape — aspect_ratio such as "16:9" or "1:1" plus focus, the part to keep ("top", "left", "center" and so on), which needs no pixel coordinates — or by an exact crop_box in pixels. The result is saved as a new media item and the original is untouched, unless in_place is set: then the image itself changes, its original is kept, and mosmcp/media-restore-original puts it back. Order: rotate, flip, crop, then resize; images are never enlarged.

Also known as: crop photo, rotate picture, resize image, make square, banner crop.

Property Value
Ability slug mosmcp/media-edit-image
Wire tool name mosmcp__media-edit-image
Category Media (mosmcp-media)
Plan Free

 

Required access

Requirement Value
Capability edit_post (checked against the specific post)
Minimum default role Contributor
Annotations readOnly: false · destructive: false · idempotent: false · openWorld: false

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — The image to edit.
aspect_ratio string — Crop to this shape: "16:9", "4:3", "3:2", "1:1", "9:16" or "square". The largest such box is kept.
focus string (one of center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right) center With aspect_ratio: which part of the image to keep.
crop_box object —
crop_box.x integer (min 0) Yes —
crop_box.y integer (min 0) Yes —
crop_box.width integer (min 1) Yes —
crop_box.height integer (min 1) Yes —
rotate integer (one of 90, 180, 270) — Degrees clockwise: 90, 180 or 270.
flip string (one of horizontal, vertical, both) — "horizontal" mirrors left to right, "vertical" turns upside down.
width integer (min 1) — Resize to at most this width, keeping the proportions.
height integer (min 1) — Resize to at most this height, keeping the proportions.
in_place boolean — Change the image itself instead of saving a new media item. Needs confirm.
confirm boolean — With in_place: true once the person has agreed.
title string — Title for the new media item. Defaults to the original's, marked "(edited)".

 

Output schema

Field Type Required Description
id integer Yes
title string
url string Yes
filename string
width integer
height integer
edit_url string
copy boolean True when the result is a new media item.
from integer The image it was made from.
steps string[]
notes string[]

 


<< Previous Next >>
Delete Media Permanently Find Media (ID by Name / Name by ID)

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.