Skip to content

Demo vault

Every screenshot and code block on this page comes from the bundled demo vault.

Download the English demo vault

Cropping ​

ag:crop sets the frame ratio and ag:top sets where the frame lands on the source; if you would rather not compute coordinates, use the crop dialog.

Uncropped ​

markdown
![Original](assets/photo/05-falls.jpg)
The source photo shown in full at 16:9

The source is 16:9 and is shown completely.

Cropped to a square ​

The same photo cropped to 1:1, taking 25%-75% horizontally and starting 2% from the top
markdown
![square|ag:crop=1:1|ag:top=25:75:2](assets/photo/05-falls.jpg)

ag:crop=1:1 makes the frame square; ag:top=25:75:2 takes 25%–75% horizontally, starting 2% down. Only one vertical number is written because the height follows from the ratio.

Any region you like ​

markdown
![Top left|ag:crop=24:17|ag:top=0:50:0](assets/ratio/ratio-4x3.svg)
![Upper right|ag:crop=1:1|ag:top=40:80:20](assets/ratio/ratio-4x3.svg)
Two regions of the same calibration image: the top-left corner and a square from the upper right

The first takes the top-left corner, the second a square from the upper right. Out-of-range values are clamped and swapped edges are corrected, so you never end up with a blank frame.

The crop dialog ​

Hover an image and click the scissors icon if you would rather not compute coordinates. The dialog writes exactly two parameters: ag:crop and ag:top.

ActionEffect
Drag an edgemove that edge only, the other three stay
Drag a cornermove the two adjacent edges together
Shift + draglock the current ratio
Alt + dragscale symmetrically around the centre
Wheelzoom the editing view (1–4×) without changing the result
Ratio menufree / current / 1:1 / 4:3 / 3:2 / 16:9 / 9:16 / 3:4 / 2:3
Savewrites ag:crop and ag:top
Clear cropremoves both parameters, restoring the full frame
Reset viewpulls the frame back to the whole image, dialog stays open

Two details:

  • "Current ratio" appears only when no preset is locked; the next open reuses the last choice.
  • When the frame covers the whole image, saving writes nothing — otherwise "not cropped" would be recorded as "cropped to the original ratio", locking the ratio forever.

With unsaved changes, clicking outside, pressing Esc or cancelling first asks whether to discard them.

The dialog opens in Live Preview; reading view has no entry point.

Cropping changes width routing ​

After cropping, the plugin uses the cropped ratio, not the source ratio: a 16:9 image cropped to 1:1 narrows from nearly full-column to about half, and the float decision is made again.

So cropping changes more than the visible frame — it changes where the image sits on the page. That is expected behaviour.

If a frame would push the bottom edge past the source, the plugin widens the frame instead of cutting content: a little extra picture rather than losing the edge you asked for.

Two limits ​

LimitExplanation
ag:top needs ag:cropwithout a crop, rewriting parameters drops the top
tables accept only croppingtable cells do not support width or floating, see Nested scopes

Next ​