wordpress/wp-content/themes/basic/themify/img.php
/**
 * Disable the min commands to choose the minimum dimension, thus enabling image enlarging.
 *
 * @param $default
 * @param $orig_w
 * @param $orig_h
 * @param $dest_w
 * @param $dest_h
 * @return array
 */
Disable the min commands to choose the minimum dimension, thus enabling image enlarging.
Disable the min commands to choose the minimum dimension thus enabling image enlarging .
function themify_img_resize_dimensions( $default, $orig_w, $orig_h, $dest_w, $dest_h ) {
	$aspect_ratio = $orig_w / $orig_h;
	$new_w = $dest_w;
	$new_h = $dest_h;
	if ( !$new_w ) {
		$new_w = (int)( $new_h * $aspect_ratio );
	}
	if ( !$new_h ) {
		$new_h = (int)( $new_w / $aspect_ratio );
	}
	$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );
	$crop_w = round( $new_w / $size_ratio );
	$crop_h = round( $new_h / $size_ratio );
	$s_x = floor( ( $orig_w - $crop_w ) / 2 );
	$s_y = floor( ( $orig_h - $crop_h ) / 2 );
	return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );
}
function themify_img_resize_dimensions ( $ default , $ orig_w , $ orig_h , $ dest_w , $ dest_h ) { $ aspect_ratio = $ orig_w / $ orig_h ; $ new_w = $ dest_w ; $ new_h = $ dest_h ; if ( ! $ new_w ) { $ new_w = ( int ) ( $ new_h * $ aspect_ratio ) ; } if ( ! $ new_h ) { $ new_h = ( int ) ( $ new_w / $ aspect_ratio ) ; } $ size_ratio = max ( $ new_w / $ orig_w , $ new_h / $ orig_h ) ; $ crop_w = round ( $ new_w / $ size_ratio ) ; $ crop_h = round ( $ new_h / $ size_ratio ) ; $ s_x = floor ( ( $ orig_w - $ crop_w ) / 2 ) ; $ s_y = floor ( ( $ orig_h - $ crop_h ) / 2 ) ; return array ( 0 , 0 , ( int ) $ s_x , ( int ) $ s_y , ( int ) $ new_w , ( int ) $ new_h , ( int ) $ crop_w , ( int ) $ crop_h ) ; }
Disable the min commands to choose the minimum dimension, thus enabling image enlarging.
Disable the min commands to choose the minimum dimension thus enabling image enlarging .
// set portion of the original image that we can size to $dest_w x $dest_h // the return array matches the parameters to imagecopyresampled() // int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h