public static function resize( $img_size, $file_src, $width, $height, $crop, $force ) {
		// Check if image should be converted to JPG first
		if ( self::should_convert_to_jpg( $img_size, $file_src ) ) {
			// Sort out background color which will show instead of transparency
			$bgcolor  = is_string( $img_size['tojpg'] ) ? $img_size['tojpg'] : '#FFFFFF';
			$file_src = Timber\ImageHelper::img_to_jpg( $file_src, $bgcolor, $force );
		}

		// Check for letterbox parameter
		if ( isset( $img_size['letterbox'] ) && $img_size['letterbox']
			&& $width > 0 && $height > 0
		) {
			$color = is_string( $img_size['letterbox'] ) ? $img_size['letterbox'] : '#000000';
			return Timber\ImageHelper::letterbox( $file_src, $width, $height, $color );
		} else {
			return Timber\ImageHelper::resize( $file_src, $width, $height, $crop, $force );
		}
	}
public static function resize( $img_size, $file_src, $width, $height, $crop, $force ) {
		// Check if image should be converted to JPG first
		if ( self::should_convert_to_jpg( $img_size, $file_src ) ) {
			// Sort out background color which will show instead of transparency
			$bgcolor  = is_string( $img_size['tojpg'] ) ? $img_size['tojpg'] : '#FFFFFF';
			$file_src = Timber\ImageHelper::img_to_jpg( $file_src, $bgcolor, $force );
		}

		// Check for letterbox parameter
		if ( isset( $img_size['letterbox'] ) && $img_size['letterbox']
			&& $width > 0 && $height > 0
		) {
			$color = is_string( $img_size['letterbox'] ) ? $img_size['letterbox'] : '#000000';
			return Timber\ImageHelper::letterbox( $file_src, $width, $height, $color );
		} else {
			return Timber\ImageHelper::resize( $file_src, $width, $height, $crop, $force );
		}
	}
public static function resize ( $ img_size , $ file_src , $ width , $ height , $ crop , $ force ) { // Check if image should be converted to JPG first if ( self :: should_convert_to_jpg ( $ img_size , $ file_src ) ) { // Sort out background color which will show instead of transparency $ bgcolor = is_string ( $ img_size [ 'tojpg' ] ) ? $ img_size [ 'tojpg' ] : '#FFFFFF' ; $ file_src = Timber \ ImageHelper :: img_to_jpg ( $ file_src , $ bgcolor , $ force ) ; } // Check for letterbox parameter if ( isset ( $ img_size [ 'letterbox' ] ) && $ img_size [ 'letterbox' ] && $ width > 0 && $ height > 0 ) { $ color = is_string ( $ img_size [ 'letterbox' ] ) ? $ img_size [ 'letterbox' ] : '#000000' ; return Timber \ ImageHelper :: letterbox ( $ file_src , $ width , $ height , $ color ) ; } else { return Timber \ ImageHelper :: resize ( $ file_src , $ width , $ height , $ crop , $ force ) ; } }
Resize an image and apply letterbox and tojpg filters when defined.

@since 0.9.2

@param  array  $img_size Configuration values for an image size.
@param  string $file_src The src of the original image.
@param  int    $width    The width the new image should be resized to.
@param  int    $height   The height the new image should be resized to.
@param  string $crop     Optional. Cropping option. Default 'default'.
@param  bool   $force    Optional. Force cropping. Default false.

@return string The src of the image.
Resize an image and apply letterbox and tojpg filters when defined .