<?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 Images uploaded in my HubSpot CMS environment keep getting cropped in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152283#M43029</link>
    <description>&lt;P&gt;I’m looking for clues because I can’t identify the root cause.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;Situation&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The issue occurs only with images that live &lt;STRONG&gt;inside my custom theme&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The theme is connected to &lt;STRONG&gt;Design Manager&lt;/STRONG&gt;, and all theme source code, image assets, and CSS files are version-controlled in &lt;STRONG&gt;Git&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;Workflow&lt;/H4&gt;&lt;P&gt;When I start development or maintenance work, I always pull the latest changes with:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;npx hs fetch --overwrite theme-name theme-name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Symptoms&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;After running the command above, &lt;STRONG&gt;some image directories inside the theme are fetched as “differences,”&lt;/STRONG&gt; even though I haven’t touched them.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Of those images:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Some appear unchanged.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Others mysteriously have part of the image missing or “cropped.”&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This makes me think the Design Manager copy and my Git copy are somehow diverging, but I can’t pinpoint why. I’m wondering if the watch command (auto-watch &amp;amp; upload) could be involved.&lt;/P&gt;&lt;H4&gt;Temporary fix&lt;/H4&gt;&lt;P&gt;If an image is corrupted, I can restore it with:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;npx hs upload theme-name theme-name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;This uploads the intact local asset and overwrites the corrupted one.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;&lt;H3&gt;Question&lt;/H3&gt;&lt;P&gt;Why does this keep happening?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Has anyone seen a similar case?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Could it be an operational mistake on my side?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;What mechanisms (fetch, watch, caching, etc.) might cause random image files in a theme to become partially overwritten or corrupted on fetch?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any insights or past experiences would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 14 May 2025 09:53:27 GMT</pubDate>
    <dc:creator>TMisuna</dc:creator>
    <dc:date>2025-05-14T09:53:27Z</dc:date>
    <item>
      <title>Images uploaded in my HubSpot CMS environment keep getting cropped</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152283#M43029</link>
      <description>&lt;P&gt;I’m looking for clues because I can’t identify the root cause.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;Situation&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The issue occurs only with images that live &lt;STRONG&gt;inside my custom theme&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The theme is connected to &lt;STRONG&gt;Design Manager&lt;/STRONG&gt;, and all theme source code, image assets, and CSS files are version-controlled in &lt;STRONG&gt;Git&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;Workflow&lt;/H4&gt;&lt;P&gt;When I start development or maintenance work, I always pull the latest changes with:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;npx hs fetch --overwrite theme-name theme-name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Symptoms&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;After running the command above, &lt;STRONG&gt;some image directories inside the theme are fetched as “differences,”&lt;/STRONG&gt; even though I haven’t touched them.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Of those images:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Some appear unchanged.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Others mysteriously have part of the image missing or “cropped.”&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This makes me think the Design Manager copy and my Git copy are somehow diverging, but I can’t pinpoint why. I’m wondering if the watch command (auto-watch &amp;amp; upload) could be involved.&lt;/P&gt;&lt;H4&gt;Temporary fix&lt;/H4&gt;&lt;P&gt;If an image is corrupted, I can restore it with:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;npx hs upload theme-name theme-name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;This uploads the intact local asset and overwrites the corrupted one.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;&lt;H3&gt;Question&lt;/H3&gt;&lt;P&gt;Why does this keep happening?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Has anyone seen a similar case?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Could it be an operational mistake on my side?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;What mechanisms (fetch, watch, caching, etc.) might cause random image files in a theme to become partially overwritten or corrupted on fetch?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any insights or past experiences would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 09:53:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152283#M43029</guid>
      <dc:creator>TMisuna</dc:creator>
      <dc:date>2025-05-14T09:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Images uploaded in my HubSpot CMS environment keep getting cropped</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152442#M43032</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/749449"&gt;@TMisuna&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;never run into this and it's very interesting that it happens during the "fetch" command. Because this means it's related to HubSpot, as you fetch from HS, not from GitHub.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have set up the &lt;A href="https://developers.hubspot.com/docs/guides/cms/setup/github-integration" target="_blank" rel="noopener"&gt;continuous GitHub integration&lt;/A&gt;, the default workflow is: that every "hs upload..." will upload it to GitHub and the GitHub action pushes it to HubSpot. But fetching will fetch from HS, not GitHub.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Years ago, I had a super hard time working with the CI, when I was developing a custom theme and had to wait 1-2 minutes to see the changes in HubSpot, every time I saved a file (I think there was no local server back then),... This is why I've changed my workflow to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;set up a cms sandbox account (app test account) here: &lt;A href="https://developers.hubspot.com/" target="_blank" rel="noopener"&gt;developers.hubspot.com&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Run "hs watch --account=HUB_ID_OF_SANDBOX ..." in a terminal&lt;/LI&gt;
&lt;LI&gt;once a feature is fully developed and approved, I manually push it to GitHub and let the GitHub action upload it to the live portal&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When it comes to images, I'm trying to use SVGs where-ever possible. I'm also not using .webP format as it can only be opened/modified with design tools like Photoshop outside of a browser. So a marketer/content-editor, who doesn't have access to such tools can't use them. Sure they're mostly preview images, but still...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;p.s. A developer account (the one you create on developers.hubspot.com) can have upto 10 or 20 (not sure) test accounts. This means you can have one developer account and 10/20 test accounts (cms sandboxes) -&amp;gt; 10/20 seperate client approval portals within one portal&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 14:57:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152442#M43032</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2025-05-14T14:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Images uploaded in my HubSpot CMS environment keep getting cropped</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152576#M43035</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/749449"&gt;@TMisuna&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Potential Causes&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;CLI Fetch Behavior with Binary Files&lt;/STRONG&gt;&lt;BR /&gt;The &lt;EM&gt;hs fetch&lt;/EM&gt; command is designed to retrieve theme files from HubSpot's Design Manager to your local environment. However, there have been reports of unexpected behavior when fetching binary files, such as images. In some instances, images fetched using the CLI appear corrupted or incomplete. This might be due to the way the CLI handles binary data during the fetch process.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Conflict Between Local and Remote Versions&lt;/STRONG&gt;&lt;BR /&gt;Using the &lt;EM&gt;--overwrite&lt;/EM&gt; flag forces the local files to be replaced with the remote versions. If there are discrepancies between the local and remote repositories, especially with binary files, this could lead to corrupted images. The remote version may be incomplete or corrupted, and fetching it overwrites the intact local version.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Watch Command Interference&lt;/STRONG&gt;&lt;BR /&gt;The &lt;EM&gt;hs watch&lt;/EM&gt; command monitors local files for changes and uploads them to HubSpot in real-time. If &lt;EM&gt;hs watch&lt;/EM&gt; is running concurrently with &lt;EM&gt;hs fetch&lt;/EM&gt;, there might be conflicts, especially if both commands are trying to access or modify the same files simultaneously. This could result in partial overwrites or corrupted files.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you can manage image assets separately from your theme files. You can upload images directly through the &lt;A href="https://developers.hubspot.com/docs/guides/cms/storage/file-manager" target="_blank" rel="noopener"&gt;HubSpot File Manager&lt;/A&gt; or use the CMS to manage these assets. This approach ensures that image assets are not affected by theme fetch operations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kosala&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 19:20:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152576#M43035</guid>
      <dc:creator>kosalaindrasiri</dc:creator>
      <dc:date>2025-05-14T19:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Images uploaded in my HubSpot CMS environment keep getting cropped</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152751#M43039</link>
      <description>&lt;P&gt;Thank you for your reply. I still haven’t pinpointed the exact root cause, but learning that it might be related to how binary files are handled is a valuable clue. I appreciate the big hint!&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 07:12:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152751#M43039</guid>
      <dc:creator>TMisuna</dc:creator>
      <dc:date>2025-05-15T07:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Images uploaded in my HubSpot CMS environment keep getting cropped</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152753#M43040</link>
      <description>&lt;P&gt;Thank you for your response. I found several aspects of your development workflow that I’d like to adopt myself. I appreciate the valuable insights you shared.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 07:13:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1152753#M43040</guid>
      <dc:creator>TMisuna</dc:creator>
      <dc:date>2025-05-15T07:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Images uploaded in my HubSpot CMS environment keep getting cropped</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1165199#M43288</link>
      <description>&lt;P&gt;That’s super frustrating! I’ve been burned by hs fetch clobbering stuff too. Are you running hs watch before the fetch finishes?&lt;/P&gt;&lt;P&gt;Try this:&lt;BR /&gt;Kill any running hs watch before hs fetch --overwrite, then restart watch after. That fetch can trigger a weird sync loop if watch is live—Design Manager pushes up junk or stale files right as you’re pulling.&lt;/P&gt;&lt;P&gt;I once had a JPG randomly zero out after a fetch because hs watch caught a partial write mid-sync. Let me know if pausing watch helps.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 12:30:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Images-uploaded-in-my-HubSpot-CMS-environment-keep-getting/m-p/1165199#M43288</guid>
      <dc:creator>Nhal</dc:creator>
      <dc:date>2025-06-16T12:30:28Z</dc:date>
    </item>
  </channel>
</rss>

