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

Remove garbage alt text from images attached via Gboard #4068

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

untitaker
Copy link
Contributor

@untitaker untitaker commented Oct 22, 2023

Steps to reproduce:

  1. install Gboard
    (https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin)

  2. open a direct link to any image in Firefox

  3. long-press the image to get a "Copy Image" dialogue (and copy the
    image)

  4. compose a new post in Tusky

  5. Gboard will suggest to paste the image from clipboard

  6. paste image, see that when opening alt text editor, it is filled out
    with this garbage string

Why is this bad? It's not when I just fix the alt text. But it breaks
every mechanism that is supposed to remind me of adding alt text.

It's hard to argue that this is within scope of Tusky but I also don't
see it getting fixed in Gboard, so here we go.

Steps to reproduce:

1. install Gboard
   (https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin)

2. open a direct link to any image in Firefox
3. long-press the image to get a "Copy Image" dialogue (and copy the
   image)
4. compose a new post in Tusky
5. Gboard will suggest to paste the image from clipboard
6. paste image, see that when opening alt text editor, it is filled out
   with this garbage string

Why is this bad? It's not when I just fix the alt text. But it breaks
every mechanism that is supposed to remind me of adding alt text.
untitaker added a commit to untitaker/rekibots that referenced this pull request Oct 22, 2023
See also tuskyapp/Tusky#4068
and https://crab.garden/@alice/111277442112844687

It's not clear where the image/png ones are coming from though.
@connyduck
Copy link
Collaborator

Yes I agree this should be fixed, however your fix is only working for English. On my German device, it says "Bild aus der Gboard-Zwischenablage". No idea how we could handle all languages 😕.

@untitaker
Copy link
Contributor Author

untitaker commented Oct 23, 2023 via email

@Lakoja
Copy link
Collaborator

Lakoja commented Oct 23, 2023

5. Gboard will suggest to paste the image from clipboard

6. paste image, see that when opening alt text editor, it is filled out
   with this garbage string

Just as a technical question:
Why (how?) does pasting an image also set the alt text?
(Is that a sensible feature?)

@untitaker
Copy link
Contributor Author

untitaker commented Oct 23, 2023 via email

@connyduck
Copy link
Collaborator

right. some ideas:

  • extract all strings from gboard apk and paste them in here
  • check for case-sensitive substring "Gboard" instead of the exact string value

happy to spend time making either one of those solutions work, or some other solution

If "Gboard" occurs in all or most of the strings that is probably the best way.

@untitaker
Copy link
Contributor Author

just checked, seems this way:

apktool d 'Gboard - the Google Keyboard_13.4.08.559388404-beta-armeabi-v7a_Apkpure.apk'
cd .../
rg APKTOOL_DUPLICATE_string_0x7f14035d | rg -v Gboard

is empty

updated the PR

@Tak Tak merged commit 6e6cf05 into tuskyapp:develop Oct 25, 2023
@Tak
Copy link
Collaborator

Tak commented Oct 25, 2023

Thanks for your contribution, it will be available in the next release of Tusky Nightly

@untitaker untitaker deleted the fix-gboard-garbage-alt-text branch October 25, 2023 12:32
untitaker added a commit to untitaker/mastodon-android that referenced this pull request Oct 25, 2023
See also: tuskyapp/Tusky#4068

----

Steps to reproduce:

1. install Gboard
   (https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin)

2. open a direct link to any image in Firefox
3. long-press the image to get a "Copy Image" dialogue (and copy the
   image)
4. compose a new post in Tusky
5. Gboard will suggest to paste the image from clipboard
6. paste image, see that when opening alt text editor, it is filled out
   with this garbage string

Why is this bad? It's not when I just fix the alt text. But it breaks
every mechanism that is supposed to remind me of adding alt text.

It's hard to argue that this is within scope of this app but I
also don't see it getting fixed in Gboard, so here we go.
@untitaker
Copy link
Contributor Author

@Lakoja you got a real answer to your question over at mastodon/mastodon-android#722 (comment)

When you insert GIFs from Gboard, they do have sensible descriptions. Or at least they did in my testing. Also IIRC if you copy an image from a web browser, the description would be its alt text.

@charlag charlag added this to the Tusky 24 milestone Nov 18, 2023
Jacocococo pushed a commit to Jacocococo/megalodon that referenced this pull request Jul 5, 2024
See also: tuskyapp/Tusky#4068

----

Steps to reproduce:

1. install Gboard
   (https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin)

2. open a direct link to any image in Firefox
3. long-press the image to get a "Copy Image" dialogue (and copy the
   image)
4. compose a new post in Tusky
5. Gboard will suggest to paste the image from clipboard
6. paste image, see that when opening alt text editor, it is filled out
   with this garbage string

Why is this bad? It's not when I just fix the alt text. But it breaks
every mechanism that is supposed to remind me of adding alt text.

It's hard to argue that this is within scope of this app but I
also don't see it getting fixed in Gboard, so here we go.
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

Successfully merging this pull request may close these issues.

5 participants