Scale Uploaded Images

Scale uploaded images instead of cropping, based on dimensions set in the cropping settings.

Instructions

  1. Install our free Custom Javascript for Gravity Forms plugin. Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
    1. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.

Code

Filename: gpfup-scale-based-on-dimension.js

/**
 * Gravity Perks // File Upload Pro // Scale Uploaded Images
 * https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/
 *
 * Scale uploaded images instead of cropping, based on dimensions set in the cropping settings.
 *
 * Instructions:
 *   1. Install our free Custom Javascript for Gravity Forms plugin.
 *      Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
 *   2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
 */
gform.addFilter( 'gpfup_image_loader_options', function( options ) {
	options.crop = false;

	return options;
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.