> For the complete documentation index, see [llms.txt](https://minimateapps.gitbook.io/mini-image-upload-and-file-upload/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minimateapps.gitbook.io/mini-image-upload-and-file-upload/how-to.../how-to-set-image-dimensions-and-cropping.md).

# How to set image dimensions and cropping

Control the size of uploaded images and let customers crop them before adding to cart.

There are two separate rules that work together to control image quality and shape: **Image dimensions** (sets size restrictions) and **Image editor** (lets customers crop). You can use either one on its own or both together.

* Please go to the "Upload Rules" tab while creating a field
* Click "Add a rule" button

<figure><img src="https://496467855-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FH4gNmkiCvjHuxfVFianA%2Fuploads%2FUe4erZAmATRnijleRTAI%2FImage%20Dimention%20and%20Cropping1.png?alt=media&amp;token=03a4b8d8-8643-4021-9ee8-9ac41e8e43d1" alt=""><figcaption></figcaption></figure>

### **1. Image dimensions**

This rule restricts the pixel size of the images customers can upload.

* Under **File requirements**, select "Image dimensions"
* Enter the size limits you want to enforce:
  * **Minimum width** and **Maximum width** (in pixels)
  * **Minimum height** and **Maximum height** (in pixels)
* Customize the **error message** that appears when an uploaded image doesn't meet the requirements. The default is "Please check the number of files uploaded."

<figure><img src="https://496467855-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FH4gNmkiCvjHuxfVFianA%2Fuploads%2FcJuvQT1hnRRRTcY8jYUg%2FImage%20dimensions.png?alt=media&amp;token=4c98e919-f83a-488a-bcf3-21acf27ff085" alt=""><figcaption></figcaption></figure>

**When to use**

* If you need print-quality images (e.g. set a high minimum width and height)
* If you want to block oversized images that slow down processing
* If your product requires a specific size range (e.g. for engraving or printing)

{% hint style="info" %}
&#x20;You don't need to fill in all four fields. Leave a field empty if you don't want to enforce that limit — for example, set only the **minimum width** and **minimum height** if you only care about image quality, not maximum size.
{% endhint %}

### **2. Image editor (Cropping)**

This rule lets customers crop their image directly in the upload field before submitting.

* Under **Customer experience**, select "Image editor"
* Choose the cropping behavior:
  * **Allow free-form cropping** — customers can crop to any shape or size
  * **Allow square-only cropping** — customers can only crop to a square
  * **Allow circle-only cropping** — customers can only crop to a circle
  * **Allow aspect ratio cropping** — customers crop to a fixed aspect ratio you define

<figure><img src="https://496467855-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FH4gNmkiCvjHuxfVFianA%2Fuploads%2FMbJ2kc8M7HllJ8yf33OK%2FImage%20editor.png?alt=media&amp;token=6cca83f0-bd93-46b5-b085-d4c27b6ba0e9" alt=""><figcaption></figcaption></figure>

**When to use**

* If you want customers to focus on a specific part of their image
* If you need consistent shapes for printed products (e.g. circular stickers, square prints)
* If you want to give customers more control over how their image appears

{% hint style="info" %}
Cropping happens on the customer's side before the file is uploaded, so the final file you receive will already be cropped to the selected shape.
{% endhint %}

{% hint style="warning" %}
If you combine both rules, make sure your **Image dimensions** limits match the cropping shape. For example, if you require "square-only cropping" but also set very different minimum width and height values, customers may struggle to upload an acceptable image.
{% endhint %}

#### 📹 Watch: Image Dimensions

See how to set minimum or maximum width and height for uploaded images — useful for print-on-demand and quality control.

{% embed url="<https://youtu.be/n7n2T2kc4CY?si=5FPdyjJ-pRLBQemQ&t=360>" %}
