# disable image resize if height and width is given

**URL:** <https://community.hubspot.com/t/disable-image-resize-if-height-and-width-is-given/57010>\
**Category:** CMS Development\
**Created:** [May 16, 2022, 12:21pm UTC](https://community.hubspot.com/t/disable-image-resize-if-height-and-width-is-given/57010 "2022-05-16T12:21:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SJaeger](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sjaeger/32/2401_2.png) [@SJaeger](https://community.hubspot.com/u/SJaeger)\
**Post date:** [May 16, 2022, 12:21pm UTC](https://community.hubspot.com/t/disable-image-resize-if-height-and-width-is-given/57010/1 "2022-05-16T12:21:13Z")

</div>

Hello,

have someone see the possibility to disable the auto resize hubspot function if the image height and width attribute is given?

because i need only a 270px image. if i give the right width and height attribute hubspot make automaticly a srcset instead of src attribute. same on picture tags, where i dont want srcset on img tags.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 16, 2022, 8:13pm UTC](https://community.hubspot.com/t/disable-image-resize-if-height-and-width-is-given/57010/2 "2022-05-16T20:13:20Z")

</div>

Hey, @SJaeger 👋 Thanks for the great question! @Oezcan and @piersg do you have any experience here with what @SJaeger is trying to accomplish?

Thank you! – Jaycee

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [May 17, 2022, 12:24pm UTC](https://community.hubspot.com/t/disable-image-resize-if-height-and-width-is-given/57010/3 "2022-05-17T12:24:29Z")

</div>

Hi @SJaeger (thanks [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)). Yes, this is possible. Just add

?noresize

to the end of the image src e.g.

```lia-code-sample
<img src="{{module.img.src}}?noresize" alt="{{module.img.alt}}" height="{{module.img.height}}" width="{{module.img.width}}">

```

---

<div class="post-metadata">

**Author:** ![SJaeger](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sjaeger/32/2401_2.png) [@SJaeger](https://community.hubspot.com/u/SJaeger)\
**Post date:** [May 17, 2022, 12:32pm UTC](https://community.hubspot.com/t/disable-image-resize-if-height-and-width-is-given/57010/4 "2022-05-17T12:32:56Z")

</div>

hello and thanks but still not working

```lia-code-sample
<img class="img-fluid w-100" src="{{ resize_image_url(item.image.url ~ '?noresize', 270, 0, 270) }}" alt="{{ item.name|escape }}" {{ sizeAttrs }} loading="lazy">
{% require_head %}
<link rel="preload" as="image" href="{{ resize_image_url(item.image.url, 270, 0, 270) }}">
{% end_require_head %}

```

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [May 20, 2022, 8:07am UTC](https://community.hubspot.com/t/disable-image-resize-if-height-and-width-is-given/57010/5 "2022-05-20T08:07:05Z")

</div>

These both worked for me in preventing Hubspot from adding srcset and automatic resizing parameters:

```lia-code-sample
<img src="{{ resize_image_url(item.image.src ~ '?noresize', 270, 0, 270) }}" {{sizeAttrs}}>
<img src="{{item.image.src}}?noresize" {{sizeAttrs}}>

```

For the record, I see you’ve written your img src as `item.image.url` but the parameter of the image tag in Hubspot you need is `item.image.src`
