Skip to content

Offer multiple aspect ratio presets

Add multiple aspect ratio options which the user can select in the Crop primary setting.

// Offer crop ratio presets (free, square, landscape, portrait).
gform.addFilter('image_hopper_filepond_config', function(config, FilePond, $form, currentPage, formId, fieldId, entryId, files, inputField) {
  config.imageEditor.editorOptions.cropEnableSelectPreset = true
  config.imageEditor.editorOptions.cropSelectPresetOptions = [
    [undefined, 'Free'],
    [1, 'Square'],
    [4 / 3, 'Landscape'],
    [3 / 4, 'Portrait'],
  ]
  return config
}, 20, 9 )