combine check

This commit is contained in:
Mike Jolley 2019-03-18 10:59:43 +00:00
parent 19a7bb82a0
commit cbb92ef86c
1 changed files with 6 additions and 6 deletions

View File

@ -208,14 +208,14 @@ class WC_Regenerate_Images {
return $image;
}
$target_size = wc_get_image_size( $size );
$image_width = $image[1];
$image_height = $image[2];
$ratio_match = false;
$uncropped = '' === $target_size['width'] || '' === $target_size['height'];
$target_size = wc_get_image_size( $size );
$image_width = $image[1];
$image_height = $image[2];
$ratio_match = false;
$target_uncropped = '' === $target_size['width'] || '' === $target_size['height'] || ! $target_size['crop'];
// If '' is passed to either size, we test ratios against the original file. It's uncropped.
if ( $uncropped || ! $target_size['crop'] ) {
if ( $target_uncropped ) {
$full_size = self::get_full_size_image_dimensions( $attachment_id );
if ( ! $full_size || ! $full_size['width'] || ! $full_size['height'] ) {