Local HubL server issue: Images not displaying correctly

Hey everyone, I’m having a weird problem with the local HubL server for HubSpot development. Everything works fine except for images. When I try to load any image (PNG, JPG, GIF, BMP), the server seems to mess with it somehow. The images load (status 200), but they’re corrupted when I save and open them.

I’ve tried adding ‘?noresize’ to the image URLs, but it didn’t help. The only workaround I found was to encode images in BASE64 and save them as .txt files, then load them with inline styling. But that’s not ideal.

Has anyone run into this before? Any ideas what might be causing it? I’m using Ubuntu 15.10 with Java 1.8.0_91.

Thanks for any help!

I’ve encountered a similar issue with the local HubL server and image corruption. In my case, it turned out to be related to file permissions on Ubuntu. Here’s what worked for me:

First, check the permissions of your image directory. Make sure the web server has read access. You can use ‘chmod 755’ on the directory and ‘chmod 644’ on the image files.

If that doesn’t solve it, try clearing your browser cache and restarting the local HubL server. Sometimes caching can cause weird display issues.

Another thing to consider is your Java version. I found upgrading to the latest LTS version (Java 11 or 17) resolved some quirks with the local server.

Lastly, double-check your image paths in the HubL templates. Ensure they’re correct and use relative paths when possible.

Hope this helps! Let me know if you need any clarification on these steps.