Image issues (publication logo, image, post images, etc)

Both index.hbs and floating-header.hbs are looking for images either in the wrong directory, or that don’t exist… seems image processing changed and these two files were not made aware?

I noticed this while using my Casper Dark theme, but applied the stock casper theme and it’s doing the same thing… Casper theme is v2.10.3, my Casper Dark fork is based on that version as well.

index.hbs issue

When a Publication logo is uploaded, chrome console reports the following when loading the main page of the site.

Failed to load resource: the server responded with a status of 404 ()

Which refers to the file /content/images/size/w1000/2019/07/logo-transparent-smaller-1.png.

floating-header.hbs issue

Both firefox and chrome insert the alt text for the site icon, since they can’t seem to find the file.

GET 404

Requested Information

  • URL?
  • Version: 2.25.6 (Casper 2.10.3)
  • Configuration? ???
  • Browser? FF 67.0.4, Chrome 75.0.3770.100
  • Console errors? See above*
  • Reproduce:
    • Upload publication logo and load the main page (for index.hbs issue)
    • Scroll down on a post (for floating-header.hbs issue)

Did you try to use svg instead?

Open the logo in svg format in an editing software (like sublime text/atom…), copy the code created by the software, paste this code where you want it placed,

@Matt-B, while I appreciate you taking the time to respond, your suggested workaround is not a fix to an issue with a function provided by the platform. This was post was more of a bug report, in hopes that the problem could be resolved as more users could be impacted by the issue.

Publication icon and Publication logo are built in optional configurations provided in the admin panel. The icon only accepts .png formats for upload, the *logo will accept an .svg (and other formats).

Updated the thread title because I just added an image to a post and it was not loading, again only the <alt text> loaded.

Inspector shows its trying to load an image from /content/images/size/w2000/2019/07/banner-1.png

That directory doesn’t even exist on the host;

webhost:/var/www/ghost$ ll content/images/size/w2000/2019/
total 12K
drwxr-xr-x 3 ghost ghost 4.0K Mar  3 17:06 ./
drwxr-xr-x 3 ghost ghost 4.0K Mar  3 17:06 ../
drwxr-xr-x 2 ghost ghost 4.0K Mar 29 00:42 03/

Sized images are generated on the fly when requested - do you have some nginx/apache config that is trying to serve image files directly rather than passing through to the Ghost instance?

1 Like

@Kevin, seems so, thanks for pointing me in the right direction.

I had the following in my nginx config;

    location ^~ /content/images/ {
        root /var/www/ghost;

I think I saw that from an optimization blog somewhere; the images are working again after commenting that out and reloading nginx.

@derek-shnosh you may want to check out this topic, it has some slightly more advanced config that will get you the direct-file-serving back Ghost Blog - Nginx Location@Content

1 Like