gpfup_jpeg_quality (JS)

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Increase JPEG quality to 1 (100%) for all uploaded images
  5. Since

Description

Filter the quality used for JPEGs when auto-cropping and manual cropping.

Usage

gform.addFilter( 'gpfup_jpeg_quality', my_custom_function );

Parameters

  • jpegQuality float

    0-1 representation of JPEG quality. Defaults to 0.92.

  • formId int

    The current form ID

  • fieldId int

    The current uploader field ID

  • gpfupInstance GPFUPField

    Current File Upload Pro class instance

Examples

Increase JPEG quality to 1 (100%) for all uploaded images

/**
 * Gravity Perks // File Upload Pro // Set JPEG Quality for all Uploaded Images
 * https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/
 *
 * 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.
 */
window.gform.addFilter( 'gpfup_jpeg_quality', function () {
	// Update '1' to the desired quality. 1 represents 100%.
	return 1;
} );

Since

This filter is available since Gravity Forms File Upload Pro 1.0.4.