Skip to content

Progressive image loading paramater #20

@delnolan

Description

@delnolan

Hi @junaidbhura

I wanted to pass the 'fl_progressive' paramater for image loading but the option wasn't available.

I edited class-core.php to enable the option and then I just passed an empty string for 'progressive' in $args.

public function build_transformation_slug( $args = array() ) {
	if ( empty( $args ) ) {
		return "";
	}
	$cloudinary_params = array(
		'angle'                => 'a',
		'aspect_ratio'         => 'ar',
		'background'           => 'b',
		'border'               => 'bo',
		'crop'                 => 'c',
		'color'                => 'co',
		'dpr'                  => 'dpr',
		'duration'             => 'du',
		'effect'               => 'e',
		'end_offset'           => 'eo',
		'flags'                => 'fl',
		'height'               => 'h',
		'overlay'              => 'l',
		'opacity'              => 'o',
		'quality'              => 'q',
		'radius'               => 'r',
		'start_offset'         => 'so',
		'named_transformation' => 't',
		'underlay'             => 'u',
		'video_codec'          => 'vc',
		'width'                => 'w',
		'x'                    => 'x',
		'y'                    => 'y',
		'zoom'                 => 'z',
		'audio_codec'          => 'ac',
		'audio_frequency'      => 'af',
		'bit_rate'             => 'br',
		'color_space'          => 'cs',
		'default_image'        => 'd',
		'delay'                => 'dl',
		'density'              => 'dn',
		'fetch_format'         => 'f',
		'gravity'              => 'g',
		'prefix'               => 'p',
		'page'                 => 'pg',
		'video_sampling'       => 'vs',
                    'progressive'       => 'fl_progressive',
	);

	$slug = array();
	foreach ( $args as $key => $value ) {
		if ( array_key_exists( $key, $cloudinary_params ) && $this->valid_value( $cloudinary_params[ $key ], $value ) && $key != 'progressive' ) {
			$slug[] = $cloudinary_params[ $key ] . '_' . $value;
		}
		if($key == 'progressive'){
                    $slug[] = $cloudinary_params[ $key ];
               }
	}
	return implode( ',', $slug );
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions