Mastodon: Image Alt Text is Cut at 420 Characters when Federated

Created on 30 Oct 2019  ·  4Comments  ·  Source: tootsuite/mastodon

Expected behaviour

Federated versions of a toot should include the full image alt text of the original toot.

Actual behaviour

Federated versions of a toot include only the first 420 (nice) characters, truncating anything beyond.

Steps to reproduce the problem

  1. Create a toot with an image
  2. Set the alt text for that image to something longer than 420 characters
  3. View that toot from another instance

Specifications

Screenshot showing full image alt text on original toot:
A screenshot of a toot about Bernie Sanders with a text screenshot as the image. The full text of the screenshot is shown in the alt text of the image as shown by the developer tools window to the right of the page with the HTML image tag highlighted.

Screenshot showing boosted toot's truncated image alt text on a user profile page.
A screenshot of a toot as viewed from the public profile page of a user from another instance who boosted the toot- the alt text is truncated at 420 characters.

Testing Details
We were able to reproduce the issue between the following server versions:

Originating Version | Federated Version
------------ | -------------
Mastodon 3.0.1 | Mastodon 3.0.1
Mastodon 3.0.1 | v3.0.1+glitch+vulpine-prod-20191017-02
v3.0.1+glitch+vulpine-prod-20191017-02 | Mastodon 3.0.1

We tested and verified the issue in multiple browsers:
Firefox, Waterfox, Chrome and Opera.

And on multiple (API based) clients:
Tusky, Pinafore

Most helpful comment

Thanks both 🌟.

I’ve filed a new issue here: https://github.com/tootsuite/mastodon/issues/12268

All 4 comments

May I propose we communicate the 420 characters limit rather than allow more than 420 characters? 420 characters is a lot of text. As an example, screen readers will read the entire alt text in one go. Users can’t navigate it word by word. If your image needs more than 420 characters to be described it probably requires a transcript rather than alt text.

To prove a point: this entire comment is exactly 420 characters.

@ZoeBijl I would recommend making your suggestion elsewhere, as this is a bug report and not a feature request where such a discussion would be warranted.

This issue was raised to ensure the (communicated) 1,500 character limit in image descriptions federates. There is a disconnect between the character limit in the image description text and the character limit in federating that image description. It appears the bug has already been fixed above, just waiting for it to be included in a release.

@ZoeBijl This seems like a technicality bug (what we expect is not what happens) and I assume @psydwannabe meant a separate issue should be filed (alt text for images should be limited to some number of characters).
That separate issue could also propose a feature (some way of linking semantic text to an image)-- something the bird site for example doesn't have (I've been using Pastebin and it sucks :/).

Thanks both 🌟.

I’ve filed a new issue here: https://github.com/tootsuite/mastodon/issues/12268

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KellerFuchs picture KellerFuchs  ·  3Comments

svetlik picture svetlik  ·  3Comments

selfagency picture selfagency  ·  3Comments

thomaskuntzz picture thomaskuntzz  ·  3Comments

flukejones picture flukejones  ·  3Comments