---
title: "Commit an image crop with a visible framing oracle"
description: "Verify that a crop editor distinguishes draft framing from saved output using prepared landmark positions and a separately recorded crop contract."
canonical_url: "https://vostride.com/agent-library/files-media/image-crop-preview-commit.md"
md_url: "https://vostride.com/agent-library/files-media/image-crop-preview-commit.md"
content_kind: "recipe"
topic: "files-media"
---

# Commit an image crop with a visible framing oracle

Verify that a crop editor distinguishes draft framing from saved output using prepared landmark positions and a separately recorded crop contract.

## Risk

A crop preview can appear correct while the saved image uses old coordinates or crops the wrong axis. Use a prepared source with obvious landmarks instead of judging an arbitrary photograph aesthetically.

## Fixtures

- A test app-resident image contains a centered blue square, a red marker at the left edge, and a green marker at the right edge.
- The intended square crop retains the centered blue square while excluding both edge markers.
- The product provides an in-app crop editor; source upload and binary image analysis are handled by approved fixture setup.

## Steps

1. Open the source preview and verify the center square and both edge markers are initially visible.
2. Enter the crop editor, choose the square crop preset, and position the crop around the central square.
3. Verify the draft preview retains the blue square and excludes the red and green edge markers before saving.
4. Commit the crop and verify the saved preview has square framing with the same included and excluded landmarks.
5. Reload the asset and reopen its saved preview; verify the crop persists and use a prepared image verifier if exact output dimensions are part of the requirement.

## Expected results

- The saved rendering preserves the central landmark while excluding both known edge landmarks.
- The post-reload preview agrees with the draft that was explicitly committed.
- Any claim about exact pixel dimensions comes from the separate image verifier, not visual estimation.

## False-pass traps

- A square editor mask over an unchanged source does not prove a crop was saved.
- Checking only one edge can miss a horizontally shifted crop that removes the subject on the other side.

## Cleanup

- Restore the original fixture version or delete the cropped test asset.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Files and media QA recipes](/agent-library/files-media.md)
- [Software factory QA library](/agent-library.md)
