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.
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
piersg
May 17, 2022, 12:24pm
3
Hi @SJaeger (thanks @Jaycee_Lewis ). Yes, this is possible. Just add
?noresize
to the end of the image src e.g.
<img src="{{module.img.src}}?noresize" alt="{{module.img.alt}}" height="{{module.img.height}}" width="{{module.img.width}}">
hello and thanks but still not working
<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 %}
These both worked for me in preventing Hubspot from adding srcset and automatic resizing parameters:
<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