0

I have images stored in a subdirectory as follows,

+ public
+ source
  + posts
  + images
     + rss-icon.png
     + post1
       + redsquare.jpg
       + greensquare.png 

In a post I have the following,

![image](/images/post1/redsquare.jpg)  
![image](/images/post1/greensquare.png)

On a local server, all three images (rss-icon, redsquare, greensquare) render no problems.

But when I deploy to Heroku, the greensquare.png image does not work. I instead get a 404 Failed to load resource status. Both the rss-icon.png and redsquare.jpg work fine on the deployed site.

All the suggested solutions I can find apply only to Rails... for example this and this.

However I'm not using Rails...

I triple-checked the gitignore and slugignore files and there is nothing there that would cause this bias.

How can I resolve this? Any help appreciated.

EDIT: Nevermind, found a solution. It was a minor error on my part see answer below. Leaving this here in case useful to someone.

Community
  • 1
  • 1
Jet Blue
  • 5,109
  • 7
  • 36
  • 48

1 Answers1

1

Okay, so it turns out it had nothing to do with the location of the images. Instead it had to do with the lettercase of the extension.

My images looked like this,

I assumed that the extension was case-insensitive and wrote all my references using lowercase (png). But this isn't so! Changing to uppercase fixed the 404 issue.

As a side note, the uppercase PNG images were generated by Microsoft's Snipping Tool,

Jet Blue
  • 5,109
  • 7
  • 36
  • 48