Nextcloud images not displaying in Discourse

This url should embed the linked image directly into this post…

This is default behaviour of Nextcloud, which does not work within Discourse for some reason. It is discussed on the Nextcloud forum here. Thanks for any guidance or suggestions!

1 Like

I think we need an extension for images.

You need to explicitly tell it is a image if it has no image extension:





Or cheat with some query string:


That sounds right, but this does this:

Google Photos

1 Like

Now you are comparing :apple: to :banana:.

NextCloud example response is a real image, with the appropriate Mime type and everything.

Your example is an HTML document! This HTML document has a dedicated engine for oneboxing at onebox/google_photos_onebox.rb at master · discourse/onebox · GitHub.


Oops. That explains it. I guess I am :banana:!


What’s the status on this? I’d love to be able to just dump a nextcloud link and then see it as a picture in discourse! I suppose we need a button in nextcloud which copies the preview link with added ?format=.jpg by default in the sharing tab?

I’d like to be able to do this too. Hmm… let me do a test. Ok, when I get the sharing link and paste it, it becomes oneboxed. This is fine for me, though of course it would be nice if it showed up more prettily.

Here’s the same image with the ?format=.jpg appended.

Nextcloud can fix this by setting a proper og:type meta tag. Currently it is set to object. If it was set to image onebox would treat it as such.