I am trying to integrate Cloudinary into my webpage. The problem is that when I use the code below:
<div class="col-md-4 col-xs-6 text-center product-image">
<?php
echo cl_image_tag($product['product_url'],
array("width"=>400, "height"=>300, "crop"=>"fill"));
?>
</div>
The image is not responsive due to the fixed proportions: "width"=>400, "height"=>300
.
Is there a way of adjusting these parameters dynamically to the width and height that Bootstrap defines for the div?
I have tried this:
<img class="img-fluid img-thumbnail" style="max-width: 400px; max-height: 300px;" src="<?php echo $product['product_url']; ?>">
But then the size of each image is different, because each one has different dimensions and aspect ratios.