<h3>Fit an Image Within a Canvas with Given Width and Height</h3> <h4 style="margin-bottom: 10px;">(the image fits within a canvas with a given backgrond color)</h4> <p> <div class="image-container image-container-180x120"> <img src="<?php echo image_process($my_image, 180, 120, true, true); ?> " /> </div> width = 180px, height = 120px </p> <p> <div class="image-container image-container-120x180"> <img src="<?php echo image_process($my_image, 120, 180, true, true); ?> " /> </div> width = 120px, height = 180px </p> </div> </div> </section>
<div class="col-md-4"> <h3>Fit Image by Width and Height</h3> <h4 style="margin-bottom: 10px;">(the image is cropped for ratio maintaining)</h4> <p> <img src="<?php echo image_process($my_image, 160, 120); ?> " /> <br /> width = 160px, height = 120px </p> <p> <img src="<?php echo image_process($my_image, 120, 160); ?> " /> <br /> width = 120px, height = 160px </p> </div> </div> </section>