Image & Video APIs

How to always upload a square image

Last updated: Jan-29-2026

When uploading images to Cloudinary, you can use an upload preset with an incoming transformation to define the dimensions and crop the asset to a square on upload before storing it in your account. This enables you to normalize all assets that are uploaded using that upload preset.

Defining an incoming transformation for your Media Library uploads:

Steps to follow when uploading from the Cloudinary Console UI:

  1. Create an upload preset. Navigate to the Upload presets page and click on Add upload preset.
  2. Select Transform and specify the dimensions as an Incoming transformation in terms of the width and height of the asset.

    In this example, We've taken a square of dimension 500 with gravity auto so that it crops and focuses on the main part of the asset. You can find more information about gravity here.

    Note
    The above video shows an older version of the Upload Preset Settings.
  3. Once saved, you can set the new preset as your default Media Library preset (for images, videos, or both) through the Manage Defaults option, or in case you are uploading from the client side, use this preset as the unsigned upload preset.

Your uploaded assets now automatically get cropped as a square:

Example:

Original Image: Original Image

Square cropped image: Square cropped image

Here's a short video on using incoming transformations:

Note
The above video shows an older version of the Console Settings UI.

Normalizing your uploaded images programmatically:

You can also normalize uploaded images programmatically by applying an incoming transformation directly in an upload call or by passing it as a parameter to the upload preset and then specifying the upload preset in the upload call.

For details, see incoming transformations.

✔️ Feedback sent!

Rate this page:

one star two stars three stars four stars five stars