AddThisFeature

Crop and Rotate Tool

Let people crop, straighten, and rotate an image before it is saved.

moderate Media & Video

What it adds

An in-app editor that lets a user set a crop rectangle, rotate in ninety-degree steps, and straighten by a small angle before the image is stored.

What your agent is told to do

5
  1. 1

    Extend the app's existing upload flow rather than adding a separate editor screen. If avatar upload or focal-point cropping already exists, this is the same tool with more controls, not a second one.

  2. 2

    Read the image's orientation metadata and apply it before showing the canvas, so photos taken on a phone are not presented sideways and then cropped sideways.

  3. 3

    Store the crop and rotation as parameters against the untouched original, so the user can reopen the tool later, adjust, and get a different result without a fresh upload.

  4. 4

    When a surface requires a fixed aspect ratio, lock the crop rectangle to it and show that constraint in the interface rather than accepting a free crop and silently trimming it afterwards.

  5. 5

    Do not load a full-resolution photo into the canvas for editing. Work on a downscaled preview and apply the same transform to the original when saving, or large images will fail on modest devices.

Edge cases it handles

8
  • Photos carry orientation metadata that many rendering paths ignore. Normalise the image up front, otherwise the preview, the crop rectangle, and the saved output will disagree about which way is up.
  • Where a fixed aspect ratio is required, the crop handles must be constrained to it during the drag, not corrected on save. A user who framed a shot and then saw it trimmed will not trust the tool.
  • Destroying the original means a crop can never be widened again. Keep the source file and store the transform separately, so reopening the tool starts from the full image.
  • A crop of zero width or height, or one dragged entirely outside the image, must be rejected before it reaches the encoder. Enforce a minimum size and clamp the rectangle to the image bounds.
  • Decoding a very large photo into a canvas will exhaust memory on a phone and fail without a useful message. Downscale to a working size for editing and apply the transform to the original server-side.
  • Rotating by an arbitrary angle leaves empty corners. Either crop inward automatically to fill the frame or fill the corners with a stated colour, but never save transparent wedges by accident.
  • The tool needs undo and a reset to the original framing, since cropping is a sequence of adjustments rather than one decision.
  • Leaving the editor with an unapplied crop must warn rather than silently discarding the work or silently saving it.

Definition of done

9
  • Cropping happens inside the existing upload flow, not in a parallel editor.
  • Orientation metadata is applied before the image is shown and preserved through save.
  • Fixed aspect ratios constrain the crop rectangle during the drag.
  • The original file is retained and the crop can be reopened and adjusted.
  • Zero-size and out-of-bounds crops are rejected before encoding.
  • Large images are edited at a reduced preview size without memory failures.
  • Undo, reset, and an unsaved-change warning are all present.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.