Aspect Ratio Validation

Demo uploads land in a temporary store and are swept after 60 minutes. To keep files, handle FileUploaded — see Single File for the complete save pattern.
Enforce an image aspect ratio before upload

New in 5.2: a standalone aspectRatio validator (independent from the image editor). Accepts '16:9', [16,9], a decimal ratio, or a function (w,h) => boolean | string. Tolerance defaults to 1% and is tunable with aspectRatioTolerance.

What you should see: images outside the required aspect ratio are rejected at selection time, before any upload.

This demo accepts only 16:9 images (within 1% tolerance).

AjaxUploader.create('#uploader', {
    uploadUrl: '/ajaxupload.axd/upload',
    accept: 'image/*',
    aspectRatio: '16:9',          // also: [16,9], 1.7777, (w,h) => ...
    aspectRatioTolerance: 0.01    // 1% default
});