My Discourse Forum can't display images

Hi, i’ve a strange bug.
It seems i can’t display images in my Discourse forum.

when i add an image, the upload process goes fine, in the message preview i can see the image but as soon as i publish the message, the image disappear

i can’t see the image in the discussion. But if i hit “EDIT” i will see it again in the preview

What’s wrong?

Here’s a demo video https://www.ispazio.net/wp-content/uploads/2021/10/Registrazione-schermo-2021-10-11-alle-13.08.38.mov

Do you use an external provider for uploads (amazon s3) ?

If not, I have two guesses (but I’m usually bad at this): you added some css custom for cooked images and it affects uploads also you can try /safe-mode, deactivate plugins and theme et check if it works.

Or during the post processus, the forum generates an optimized image and it doesn’t work. You can try deactivating the create thumbnails setting and upload a new image (you can’t use the same, because of a caching magic that remembers this image). It will not create an optimized version and it might work.

Check the /logs page anyway, there might be some useful info

1 Like

Hi. Thanks for the reply.

I’ve tried everything with no luck. First the safe mode, not helped , second I’ve deactivated the thumbnails feature

Last thing is the logs but I can’t read the logs. What I should find there?

we’ve solved by adding this to our CSS:

.cooked img:not(.thumbnail):not(.ytp-thumbnail-image):not(.emoji), .d-editor-preview img:not(.thumbnail):not(.ytp-thumbnail-image):not(.emoji) {
width: 100% !important;
}

Thank you

My guess was going to be to turn on force https.

i have it enabled already

1 Like

If that CSS solved the problem, it’s probably because the image is shown wih 0px by default. Are you using some custom theme, or have other custom CSS code that might be causing it?

Yes you’re right. My custom theme was showing images 0x0 pixels

i’ve found the setting to change this and now everything works fine without adding the previous css code to fix

thanks for the support

1 Like