<?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: Can hubl detect an images orientation? in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326006#M15716</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/73772"&gt;@Kevin-C&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering if you still need assistance on this matter. If so,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/12898"&gt;@Dennis-DWFB&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/19908"&gt;@ajchapman20&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;what would you advise?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sharon&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2020 12:36:48 GMT</pubDate>
    <dc:creator>sharonlicari</dc:creator>
    <dc:date>2020-03-16T12:36:48Z</dc:date>
    <item>
      <title>Can hubl detect an images orientation?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/325781#M15707</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Working through a solution where I need to add classes or label images, populated via a hubdb table, based on their oriention i.e. landscape(w&amp;gt;h), portrait(w&amp;lt;h), and square(w=h). Due to the load speeds vs our user's expectations, a JS solution with a loading screen doesn't feel like the best solution. Also we don't use a loading screen pattern anywhere else on the site and I'd like to avoid that addition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently I have a small poc using jQ that listens for the images to load and then measures and assign classes. Just not very&amp;nbsp;elegant at the moment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't seen anything in the documentation, though i'm sure I could look&amp;nbsp; a little harder.&lt;/P&gt;
&lt;P&gt;And thats where my question stems from. Can hubl do something similar? Or has anyone solved a similar problem?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 15:05:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/325781#M15707</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2020-03-18T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can hubl detect an images orientation?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326006#M15716</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/73772"&gt;@Kevin-C&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering if you still need assistance on this matter. If so,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/12898"&gt;@Dennis-DWFB&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/19908"&gt;@ajchapman20&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;what would you advise?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sharon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 12:36:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326006#M15716</guid>
      <dc:creator>sharonlicari</dc:creator>
      <dc:date>2020-03-16T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can hubl detect an images orientation?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326012#M15717</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/21301"&gt;@sharonlicari&lt;/a&gt; !&lt;/P&gt;
&lt;P&gt;Yes, any input from the community is more than welcome!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 12:51:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326012#M15717</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2020-03-16T12:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can hubl detect an images orientation?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326463#M15736</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/73772"&gt;@Kevin-C&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this is what you are looking for.&amp;nbsp; You can find the orientation of images, the height to width ratio of each image, for any image inserted into an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;image module&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;custom image&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;that uses an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;image field&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can pull the height and width from the module using the page's&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://designers.hubspot.com/docs/developer-reference/debugging-and-errors#developer-info" target="_blank" rel="nofollow noopener"&gt;developer info&lt;/A&gt;&amp;nbsp;and then use a series of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://designers.hubspot.com/docs/hubl/if-statements" target="_blank" rel="nofollow noopener"&gt;if statements&lt;/A&gt;&amp;nbsp;using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://designers.hubspot.com/docs/hubl/operators-and-expression-tests#comparison" target="_blank" rel="nofollow noopener"&gt;comparison operators&lt;/A&gt;&amp;nbsp;to add classes based on the ratios of the height and width of each image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This could be most efficiently done in a custom image module that uses an image field. It will not provide the height and width of images inserted into rich text modules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's also possible that css from the template's stylesheet overrides the width and height in the module fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The X and Y position cannot be retrieved using HubL and a JavaScript solution would be better to accomplish that.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 14:57:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326463#M15736</guid>
      <dc:creator>ajchapman20</dc:creator>
      <dc:date>2020-03-18T14:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can hubl detect an images orientation?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326466#M15737</link>
      <description>&lt;P&gt;Great insight &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/19908"&gt;@ajchapman20&lt;/a&gt; !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm aware of how to make the comparision, what I'm struggling with is where to retrieve the dimensions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your responce I'm imaging that I can reference a property on the image module. Hypothetically something like this {{ image_module_img.height }}.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't had the time to dive into this solution TBH. It might be rather obvious once i get in there.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 15:12:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326466#M15737</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2020-03-18T15:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can hubl detect an images orientation?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326641#M15748</link>
      <description>&lt;P&gt;Yes, you can access the image's properties using the Dot Notation like JavaScript objects. Please see attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Developer info p&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dev-info.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/24989i0F3B9CE1A07BDBBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="dev-info.png" alt="dev-info.png" /&gt;&lt;/span&gt;age shows what objects are in your page.&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:18:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Can-hubl-detect-an-images-orientation/m-p/326641#M15748</guid>
      <dc:creator>ajchapman20</dc:creator>
      <dc:date>2020-03-19T13:18:49Z</dc:date>
    </item>
  </channel>
</rss>

