# Using resize\_image\_url incorrect image size.

**URL:** <https://community.hubspot.com/t/using-resize-image-url-incorrect-image-size/66822>\
**Category:** CMS Development\
**Created:** [October 10, 2022, 8:07pm UTC](https://community.hubspot.com/t/using-resize-image-url-incorrect-image-size/66822 "2022-10-10T20:07:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JBrake](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jbrake/32/76513_2.png) [@JBrake](https://community.hubspot.com/u/JBrake)\
**Post date:** [October 10, 2022, 8:07pm UTC](https://community.hubspot.com/t/using-resize-image-url-incorrect-image-size/66822/1 "2022-10-10T20:07:37Z")

</div>

Using resize\_image\_url I want to create images of exact sizes, how ever this doesn’t seam possible using the function resize\_image\_url:

Outcomes:

resize\_image\_url(image\_url, 1280, 0, 0, true, true) %}  
Image produced 1280px wide and original image proportional high - CORRECT

resize\_image\_url(image\_url, 0, 720, 0, true, true) %}  
Image produced 720px high and original image proportional wide - CORRECT

resize\_image\_url(image\_url, 0, 0, 1280, true, true) %}  
Image produced either width or height 1280px - CORRECT

**resize\_image\_url(image\_url, 1280, 720, 0, true, true) %}**  
**Image produced exactly 1280 wide and 720 high (eg:object-fit:cover) - INCORRECT, produced image like using length parameter or just width but not width and height together to produce the resized image at the exact size requested.**

I’ve tried with various sized images (dimensions and KB), specifying the length as well as different resize and upscale values, nothting seams to work

Are exact image sizes not possible using this funtion? or am I missing something.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 11, 2022, 9:10am UTC](https://community.hubspot.com/t/using-resize-image-url-incorrect-image-size/66822/2 "2022-10-11T09:10:07Z")

</div>

Hey [@](https://community.hubspot.com/t5/user/viewprofilepage/user-id/379041)[JBrake](https://community.hubspot.com/t5/user/viewprofilepage/user-id/163809)

In hubspot images height is set auto by default in inline styling like this

 ![ChehakWadhdwa_0-1665479392175.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/f/cfcde821f029f99ec30d42d376d5f72e88453fcd.png)

, so i think this inline auto height overlaping the height give by you , you can remove this at image level

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![JBrake](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jbrake/32/76513_2.png) [@JBrake](https://community.hubspot.com/u/JBrake)\
**Post date:** [October 12, 2022, 7:34pm UTC](https://community.hubspot.com/t/using-resize-image-url-incorrect-image-size/66822/3 "2022-10-12T19:34:56Z")

</div>

[@ChehakWadhdwa](https://community.hubspot.com/t5/user/viewprofilepage/user-id/345416), thanks for the reply. Even removing that would not produce and image with the intrinsic size required, thats just how it is styled on the page. What I am trying to do is create a responsive cover image for a video at the exact size of the video (i.e. 16:9 on all screen sizes) -

 ![image_redacted.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/9/59ae098c0f58da68baac73a89e62211c8ec0ceaa.png)

Once I get that I can adjust any styling.

Regards,

Jonathan.
