<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automatic Resizing of Feature Images in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/789445#M34026</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/149552"&gt;@mzweng&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you for taking the time to respond to my Q.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good to know that this function exists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to admit I'm still confused, though: I believed that &lt;A href="https://developers.hubspot.com/docs/cms/developer-reference/cdn" target="_blank"&gt;HubSpot would automatically serve the right one depending on the device&lt;/A&gt; in general:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;HubSpot-hosted images in CMS content are also automatically resized by appending height and/or width query parameters to the src URL for any images that have a height or width attribute. If a page is requested before an image is resized, the non-resized image will be served for that request. Browsers are given multiple options for the image resolution to load, ensuring that images look crisp on standard and high-resolution displays.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I can see that process working in some instances on websites we developed and within themes. But in both cases, without the resize_image_url() function. But then other times the process doesn't work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know, under which circumstances, HubSpot creates the &lt;EM&gt;srcset&lt;/EM&gt; by itself? Because I can't tell, really. It seems a bit random.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2023 14:36:39 GMT</pubDate>
    <dc:creator>ChrisoKlepke</dc:creator>
    <dc:date>2023-05-03T14:36:39Z</dc:date>
    <item>
      <title>Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/787292#M33961</link>
      <description>&lt;P&gt;Hey all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I know that HubSpot is optimizing uploaded images and serves the right size accordingly when used on a page.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My team and I are now wondering if that also counts for Featured Images (specifically Blog Featured Images in our current case).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From my testing, I'm unable to tell that this form of resizing is taking place, when using the&amp;nbsp;&lt;EM&gt;{{ post.featured_image }}&lt;/EM&gt; variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Can I upload a large one as a Featured Image and HubSpot automatically resizes it for mobile?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does someone of you have an insight on this?&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/363300"&gt;@Jnix284&lt;/a&gt;, is this something that came up before in your daily business or something you considered building POWER?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 13:18:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/787292#M33961</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-05-03T13:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/787457#M33966</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;happy to look into this, will see what I can find out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 21:32:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/787457#M33966</guid>
      <dc:creator>Jnix284</dc:creator>
      <dc:date>2023-04-27T21:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/787608#M33973</link>
      <description>&lt;P&gt;Very kind! Thank you&amp;nbsp;🫶&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 07:34:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/787608#M33973</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-04-28T07:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/789362#M34021</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;HubSpot is optimizing uploaded images and provides options to serve those images with the right sizes needed for particular situations/devices.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But it is the CMS developer's responsibility to tell HubSpot which sizes are needed. The function&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;resize_image_url&lt;/EM&gt; is used to do that.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{{ resize_image_url(content.featured_image, the_size_needed) }}&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;This is ideally done in theme products.&amp;nbsp;It is for the POWER theme and also applies to the featured image of blog posts.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Hope this helps &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 12:49:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/789362#M34021</guid>
      <dc:creator>mzweng</dc:creator>
      <dc:date>2023-05-03T12:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/789445#M34026</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/149552"&gt;@mzweng&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you for taking the time to respond to my Q.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good to know that this function exists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to admit I'm still confused, though: I believed that &lt;A href="https://developers.hubspot.com/docs/cms/developer-reference/cdn" target="_blank"&gt;HubSpot would automatically serve the right one depending on the device&lt;/A&gt; in general:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;HubSpot-hosted images in CMS content are also automatically resized by appending height and/or width query parameters to the src URL for any images that have a height or width attribute. If a page is requested before an image is resized, the non-resized image will be served for that request. Browsers are given multiple options for the image resolution to load, ensuring that images look crisp on standard and high-resolution displays.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I can see that process working in some instances on websites we developed and within themes. But in both cases, without the resize_image_url() function. But then other times the process doesn't work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know, under which circumstances, HubSpot creates the &lt;EM&gt;srcset&lt;/EM&gt; by itself? Because I can't tell, really. It seems a bit random.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 14:36:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/789445#M34026</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-05-03T14:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/789772#M34034</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Sure, you are welcome &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It is true that HubSpot will look for the &lt;EM&gt;width&lt;/EM&gt; or &lt;EM&gt;height&lt;/EM&gt; attributes on the &lt;EM&gt;img&lt;/EM&gt; tag. If the attributes are set, the src URL of the image will be adapted accordingly to serve the image with that dimension as soon as available.&amp;nbsp;&lt;BR /&gt;This is used for the standard image module as well as for images added via a rich-text field and this technique can be used anywhere of course.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To my knowledge, HubSpot is not creating the &lt;EM&gt;srcset&lt;/EM&gt; attribute automatically. At least for the image module and rich-text fields. Other standard modules might create the &lt;EM&gt;srcset&lt;/EM&gt; attribute.&amp;nbsp;&lt;BR /&gt;I am not sure, because we always take care of that ourselves using the function&amp;nbsp;&lt;EM&gt;resize_image_url.&lt;BR /&gt;&lt;/EM&gt;This way you can define ideal sizes across devices because you have extra knowledge of how the responsiveness of your module works, which breakpoints you use, and in which context the module is likely used. We additionally serve retina variants and use a default factor of 1.5 to achieve a good trade-off between quality and file size.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But I am happy to take a look at an example to see if the &lt;EM&gt;srcset&lt;/EM&gt; was generated automatically by HubSpot.&amp;nbsp;&lt;BR /&gt;It would make sense if a few variations would be generated for the browser to choose from.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 09:39:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/789772#M34034</guid>
      <dc:creator>mzweng</dc:creator>
      <dc:date>2023-05-04T09:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/790336#M34054</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/149552"&gt;@mzweng&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you again for the detailed response. This discussion really helps. I think to get reliable results, the method you're describing might be the best option. After all, this is probably the reason why opted for that approach as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just would love to understand what HubSpot is doing or not doing on its own. If you also have the urge to drill in deeper, here are two examples.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First is a blog that is using the Hatch Theme. As far as I can tell, there is no use of the &lt;EM&gt;resize_image_function&amp;nbsp;&lt;/EM&gt;anywhere. But if you inspect the first image in the content, HubSpot clearly created the srcset like described in the docs. Not the feature image, though. But it doesn't have a width and/or height attribute to be fair.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://emobility-magazin.com/e-autos/e-auto-versicherung/" target="_blank"&gt;https://emobility-magazin.com/e-autos/e-auto-versicherung/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other pages of the same project behave differently. Same with the second example, where I'm just messing around on a test instance just to figure things out. In this case, the srcset isn't created as well for either of the images. This time the feature image has a width/height attribute.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://25785358.hs-sites-eu1.com/blog/testing-images" target="_blank"&gt;https://25785358.hs-sites-eu1.com/blog/testing-images&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Idk man, seems all a bit random to me. Again, probably just best to care of it using the function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 09:17:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/790336#M34054</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-05-05T09:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/792057#M34109</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;you are very welcome!&amp;nbsp;&lt;BR /&gt;I also would like to understand in what situations the &lt;EM&gt;srcset&lt;/EM&gt; attribute is generated by HubSpot.&lt;BR /&gt;&lt;BR /&gt;I just had a look at your examples and noticed that the &lt;EM&gt;srcset&lt;/EM&gt; is now created for both images on your second example. Did you change something in the meantime? At least for the featured image?&lt;BR /&gt;&lt;BR /&gt;It might just take a bit of time until HubSpot serves images added via rich-text fields with a suitable &lt;EM&gt;srcset&lt;/EM&gt; attribute&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;For other images not added via rich-text, such as the featured image of a blog post, I think the theme has to take care of it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;UPDATE June, 3rd 2023 =======&lt;BR /&gt;HubSpot announced in their &lt;A title="Developer Updates - May 2023 Rollup" href="https://developers.hubspot.com/changelog/may-2023-rollup" target="_blank" rel="noopener"&gt;Developer Updates - May 2023 Rollup&lt;/A&gt; that srcset is now also supported for images on sandbox domains, such as hs-sites.com.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;=======&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Markus&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 22:59:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/792057#M34109</guid>
      <dc:creator>mzweng</dc:creator>
      <dc:date>2023-06-02T22:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/801591#M34417</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/149552"&gt;@mzweng&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sorry for the late reply. You know how it goes with releases, deadlines and the deserved&amp;nbsp;occasionally vacation &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you're onto something here, as I thought the same when reading the docs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If a page is requested before an image is resized, the non-resized image will be served for that request.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That more or less implies that it takes some time. The wording is not very precise here, but I assume it takes a couple of hours or even days to get that sorted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But like you said, this doesn't hold true for the feature images. This is definitely something our developers need to take care of.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you, again, for checking this out with me. I think we mostly solved the case&amp;nbsp;🕵️&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 07:45:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/801591#M34417</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-06-01T07:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Resizing of Feature Images</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/802512#M34456</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;no problem, that sounds exactly like our situation &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for accepting my reply as a solution.&lt;BR /&gt;&lt;BR /&gt;I edited it with some new information from the Developer Updates.&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;srcset&lt;/EM&gt; should now also works on Sandbox domains&amp;nbsp;&lt;SPAN&gt;🕵️&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I think we connected the dots together&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Markus&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 23:03:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Automatic-Resizing-of-Feature-Images/m-p/802512#M34456</guid>
      <dc:creator>mzweng</dc:creator>
      <dc:date>2023-06-02T23:03:58Z</dc:date>
    </item>
  </channel>
</rss>

