i have 3 images for specific product. all images are of different sizes. so i want all images in same height width while getting. i can resize image using resize function but its resizing only specific image not all. currently i am using this its giving me image size only for product base image. but i want for all
$this->_imageHelper->init($product, 'product_base_image' )->keepAspectRatio(TRUE)->constrainOnly(TRUE)->keepFrame(TRUE)->resize(270, 340)->getUrl()
but i am using
$images = $product->getMediaGalleryImages();
if ($images instanceof \Magento\Framework\Data\Collection) {
foreach ($images as $image) {
if ($image->getMediaType() == 'image') {
$productImagesArray[] = $image->getUrl();
} elseif ($image->getMediaType() == 'external-video') {
$videoUrl = (!empty($image->getVideoUrl())) ? $image->getVideoUrl() : $image->getVideoUrlDefault();
}
}
}
i want to resize all images from this for loop with given height width