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

alt text not surviving media post via mastodon api #975

Closed
jk-na opened this issue Sep 16, 2020 · 10 comments
Closed

alt text not surviving media post via mastodon api #975

jk-na opened this issue Sep 16, 2020 · 10 comments

Comments

@jk-na
Copy link

jk-na commented Sep 16, 2020

Hello,

I'm not sure if this perhaps relates to mastodon seemingly now using a v2 for their media api stuff but having just fixed my site so that alt text sent via the indigenous android app is rendered correctly on my hugo site, I've noticed that the alt text isn't surviving the toot process.

I have a pleroma instance but mainly it adheres to mastodon api and I don't see any pleroma specific api definitions for media.

The original post is here: https://jk.nipponalba.scot/photo/5f626c00/
Image properties in firefox show the correct associated text, and the html for the image is here <img class="u-photo" src="/media/file-20200916204815-1926.jpg" alt="close up of can of fuego sour beer from fierce beer. orange text on black can."/>

The resultant toot is here: https://social.nipponalba.scot/notice/9zE6P3t3hoWYeKLHuK
Image properties in firefox show no associated text and the html for the image is here: <img class="u-photo" src="https://social.nipponalba.scot/media/3bfe1367691c76660ab42c7c1033be10f0e10048c7438ddb4b2551dff8cc60b1.jpg?name=file.jpg" alt="" title="">

@snarfed
Copy link
Owner

snarfed commented Sep 16, 2020

hi @jk-na, sorry for the trouble, and thanks for reporting! looks like this is indeed a bridgy bug, i'll take a look soon.

@jk-na
Copy link
Author

jk-na commented Sep 16, 2020

No worries! Thanks for looking into it.

@snarfed
Copy link
Owner

snarfed commented Sep 18, 2020

i've deployed a fix for this (snarfed/granary@a742a9b), but i don't have a pleroma account etc set up for testing. @jk-na mind trying again?

@jk-na
Copy link
Author

jk-na commented Sep 18, 2020

tested, but unfortunately it's still not making it through:

original page: https://jk.nipponalba.scot/photo/5f64693d/
original source: <img class="u-photo" src="/media/file-20200918090100-3537.jpg" alt="mug of coffee, partial shot of a boox ereader , notepad and pens."/>

pleroma page: https://social.nipponalba.scot/notice/9zHEJPVXn1234i2Vlo
pleroma source: <img class="u-photo" src="https://social.nipponalba.scot/media/c0a8cca5ef79d9104265c37098d88bebd9a2dd3dc8927db4469d39375001510f.jpg?name=file.jpg" alt="" title="">

@snarfed
Copy link
Owner

snarfed commented Sep 18, 2020

hmm! looking at the bridgy log, it correctly sent a description field when it created the media attachment this time, as expected in the Mastodon API. Pleroma accepted the request, and returned 200, but the description field in the response was empty, so they didn't use it or accept it for some reason. not sure why. we may need to talk to them at this point.

I 2020-09-18 08:01:06.200521 requests.post https://social.nipponalba.scot/api/v1/media {'files': {'file': <urllib3.response.HTTPResponse object at 0x3eeb932d36d0>}, 'json': {'description': 'mug of coffee, partial shot of a boox ereader , notepad and pens.'}, 'headers': {'Authorization': '...'}}
I 2020-09-18 08:01:07.925522 Got: {'description': '', 'id': '13144322', 'pleroma': {'mime_type': 'image/jpeg'}, 'preview_url': 'https://social.nipponalba.scot/media/c0a8cca5ef79d9104265c37098d88bebd9a2dd3dc8927db4469d39375001510f.jpg?name=file.jpg';, 'remote_url': 'https://social.nipponalba.sco

@jk-na
Copy link
Author

jk-na commented Sep 19, 2020

OK, thank you. I'll raise a ticket with pleroma and see what they say, might be a site configuration option that I have or haven't enabled but I didn't notice anything when I went through the settings yesterday.

@jk-na
Copy link
Author

jk-na commented Sep 19, 2020

@jk-na
Copy link
Author

jk-na commented Sep 22, 2020

Reply from pleroma creator to my ticket:

"I think the issue is mixing json and whatever method is used to send the files. If you do both using multipart/form-data it should work"

Is this viable?

@snarfed
Copy link
Owner

snarfed commented Sep 23, 2020

thanks! yes, that makes sense, and it's an easy fix. i've deployed it. feel free to try again!

@jk-na
Copy link
Author

jk-na commented Sep 23, 2020

Success! Alt text displaying on latest image post via brid.gy! Not for the first time, many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants