Update class-wc-regenerate-images.php
Sometimes imagedata has not $imagedata['sizes']['full'] params. In my case, due to the fact that I am loading the SVG picture. Therefore, an error is visible *Undefined index: height in class-wc-regenerate-images.php on line 222* Therefore, a check for the emptiness of these parameters is added.
This commit is contained in:
parent
f90daea1d5
commit
bb8bf5f749
|
@ -219,7 +219,9 @@ class WC_Regenerate_Images {
|
|||
$imagedata['width'] = $imagedata['sizes']['full']['width'];
|
||||
}
|
||||
|
||||
$ratio_match = wp_image_matches_ratio( $image[1], $image[2], $imagedata['width'], $imagedata['height'] );
|
||||
if ( $image_size['width'] && $image_size['height'] ) {
|
||||
$ratio_match = wp_image_matches_ratio($image[1], $image[2], $imagedata['width'], $imagedata['height']);
|
||||
}
|
||||
} else {
|
||||
$ratio_match = wp_image_matches_ratio( $image[1], $image[2], $image_size['width'], $image_size['height'] );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue