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

No media shows at all when using Pleroma backend #69

Closed
Devnol opened this issue Apr 22, 2022 · 5 comments
Closed

No media shows at all when using Pleroma backend #69

Devnol opened this issue Apr 22, 2022 · 5 comments
Labels
bug Something isn't working non-standard server This issue is related to unsupported server software modifications or non-Mastodon servers

Comments

@Devnol
Copy link

Devnol commented Apr 22, 2022

I'm not sure if this happens on Mastodon-based backends but I noticed it when using the Android app connected to my Pleroma instance (social.projectsegfau.lt). Posting media works but still does not show, open in browser shows that the media has ben uploaded.

To reproduce:

  • login to a pleroma-based instance (such as the one linked above)
  • go to a post that contains media/make a post with attached media
  • observe how the media does not show at all
  • Choose Open in Browser from the kebab menu to verify media has been uploaded

Setup:
Samsung Galaxy A12 SM-A125F DS/N
Android 11 - OneUI Core 3.1
Mastodon Android 1.0.1

@Gargron
Copy link
Member

Gargron commented Apr 22, 2022

I am not against Pleroma users using the official Mastodon app, however, it is the Mastodon app and I do oppose developer resources being used to investigate Pleroma compatibility issues. If you independently determine what the issue is, we might fix it. I must remind that the Mastodon client API is not a standard and has never been intended for use with anything but Mastodon.

@Devnol
Copy link
Author

Devnol commented Apr 22, 2022

Oh I see, I haven't really looked into how the fediverse works and since I was even able to login to my instance I assumed everything was designed as interoperable. I don't really develop for android or elixir so I don't think I'll be able to do it myself, but anyone else is welcome to try I suppose.

Also lol nice issue number

@grishka grishka added bug Something isn't working non-standard server This issue is related to unsupported server software modifications or non-Mastodon servers labels May 13, 2022
@selfisekai
Copy link

not sure if this is the same issue but for me this happens strictly when:

  • post is fetched from Akkoma (upstream Pleroma not tested), AND
  • post comes an instance that does NOT run Mastodon (incl. Glitch, Hometown) - confirmed not working: Pleroma, Akkoma, Misskey, FoundKey, Calckey

the medias show if either fetching from a Mastodon account, or the post comes from a Mastodon instance.

also, even though the image does not appear, the media hiding button shows correctly.
33677.png

@selfisekai
Copy link

comparing the Akkoma responses, posts from Mastodon additionally have these parameters set in media attachments, compared to others:

{
  "blurhash": "UMINv?_2-:-:~UELD*snI;ofxZRjxut7t7W;",
  "meta": {
      "original": {
        "aspect": 0.7498496692723993,
        "height": 1663,
        "width": 1247
      }
    }
}

my hypothesis: if server sends no height/width in the response, the app renders them with the size 0x0px, as getting the the resolution fallbacks to 0 in these functions:

public int getWidth(){
if(meta==null)
return 0;
if(meta.width>0)
return meta.width;
if(meta.original!=null && meta.original.width>0)
return meta.original.width;
if(meta.small!=null && meta.small.width>0)
return meta.small.width;
return 0;
}
public int getHeight(){
if(meta==null)
return 0;
if(meta.height>0)
return meta.height;
if(meta.original!=null && meta.original.height>0)
return meta.original.height;
if(meta.small!=null && meta.small.height>0)
return meta.small.height;
return 0;
}

@grishka
Copy link
Member

grishka commented Jan 21, 2023

Returning 0 is probably not the best idea, but then it didn't break anything for anyone using a Mastodon server, so... ¯\_(ツ)_/¯

Anyway, it should be an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-standard server This issue is related to unsupported server software modifications or non-Mastodon servers
Projects
None yet
Development

No branches or pull requests

4 participants