Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared Photos not rendering on Discourse forums due to object tag #32148

Closed
sunjam opened this issue Apr 21, 2022 · 7 comments
Closed

Shared Photos not rendering on Discourse forums due to object tag #32148

sunjam opened this issue Apr 21, 2022 · 7 comments
Labels
1. to develop Accepted and waiting to be taken care of bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in.

Comments

@sunjam
Copy link

sunjam commented Apr 21, 2022

Describe the bug
Sometimes shared photos are one-boxed when they should be embedded. See this discussion on the forum for why Nextcloud photos are not displayed properly.

This is because of a missing og:type meta tag. Currently it is set to object. If it was set to image onebox would treat it as such.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...' Share Photo by url and append ?format=.jpg

Expected behavior
Image can be shared to a discourse forum and embedded with the proper url scheme.

@sunjam sunjam added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 21, 2022
@skjnldsv
Copy link
Member

skjnldsv commented Apr 23, 2022

You need to use the download link, not the preview :)
https://cloud.disroot.org/s/RSZgiiS4AmpicEF/download/bg1.jpg

![image](https://cloud.disroot.org/s/RSZgiiS4AmpicEF/download/bg1.jpg)
image

@skjnldsv
Copy link
Member

But I guess we could also do the same trick with the .jpg at the end :)

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Apr 26, 2022
@skjnldsv skjnldsv transferred this issue from nextcloud/photos Apr 26, 2022
@skjnldsv skjnldsv added the good first issue Small tasks with clear documentation about how and in which place you need to fix things in. label Apr 26, 2022
@ghost
Copy link

ghost commented May 15, 2022

Is the expected behavior:

  1. https://cloud.disroot.org/s/RSZgiiS4AmpicEF embeds as image in Discourse
  2. or https://cloud.disroot.org/s/RSZgiiS4AmpicEF/preview embeds as image in Discourse?

Based on some brief testing on https://try.discourse.org, the 2nd option already works as expected (as long as the link is on its own line).

@sunjam
Copy link
Author

sunjam commented May 15, 2022

the 2nd option already works as expected

Better to ask discourse devs literally. meta.discourse.org

Their exact advice:

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.

If you want clarification you can ask them; they are a friendly and responsive bunch.

@ghost
Copy link

ghost commented May 15, 2022

@sunjam My interpretation is that Falco's (discourse dev) suggestion was to add the og:type tag to get the 1st option to display as an embedded image instead of as "one-boxed" (as a link preview with a small image & text).

However, after reading your original post on the linked thread, I was wondering if you only expected the 2nd option to display as embedded instead of both the 1st and 2nd option--could you clarify what you imagine the "expected behavior" is?


Also, @skjnldsv I was wondering if the current behavior is what's expected--that the 1st option generates a link preview instead of an embedded image when shared on Discourse.

@leighboz
Copy link

leighboz commented Jun 2, 2022

Seems like the issue is fixed. Thread on meta.discourse.org specifically says that links with '/preview' on the end don't display inline but if you test it on try.discourse.org as carlcsaposs says, they do.

@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Seems like the issue is fixed.

thanks for checking

@szaimen szaimen closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in.
Projects
None yet
Development

No branches or pull requests

4 participants