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

TTS is reading image tags #491

Closed
ngosang opened this issue Mar 23, 2017 · 24 comments
Closed

TTS is reading image tags #491

ngosang opened this issue Mar 23, 2017 · 24 comments

Comments

@ngosang
Copy link
Contributor

ngosang commented Mar 23, 2017

wallabag app master branch

When I use Text-to-Speech it's really annoying that it read <img src="http://url..."> in each image of the article. Is there a way to exclude that tags from reading?

@nicosomb
Copy link
Member

I think that TTS must read images alternative text. It's a great feature for people who have vision troubles.

@ngosang
Copy link
Contributor Author

ngosang commented Mar 23, 2017

I agree, but not the url. Maybe replace < img alt="My text" src="url" > with "Image: My text"

@Strubbl
Copy link
Contributor

Strubbl commented Mar 23, 2017

Maybe the URL is also an important piece of information?

@ngosang
Copy link
Contributor Author

ngosang commented Mar 26, 2017

Maybe the URL is also an important piece of information?

I think it's not. Try to read this loud: => http://e00-elmundo.uecdn.es/assets/multimedia/imagenes/2017/03/26/14905243855423.jpg
It's really annoying. 😞

@tcitworld
Copy link
Member

Yeah, let's look at removing the url.

@Strubbl
Copy link
Contributor

Strubbl commented Mar 26, 2017

Maybe the URL is also an important piece of information?

I think it's not. Try to read this loud: => http://e00-elmundo.uecdn.es/assets/multimedia/imagenes/2017/03/26/14905243855423.jpg
It's really annoying. 😞

For you of course. But for people who have vision troubles?

@tcitworld
Copy link
Member

That's the purpose of the alt attribute.

@Strubbl
Copy link
Contributor

Strubbl commented Mar 26, 2017

That's the purpose of the alt attribute.

Of course. But do you have any reference, that the link is not necessary?

@tcitworld
Copy link
Member

As far as I've googled it, it's of no use. I'll ask a friend of mine who's specialized in accessiblity.

@ntnsndr
Copy link

ntnsndr commented Mar 29, 2020

Checking on this. It's a consistent problem for me. Can the app just automatically remove URL-like strings?

@di72nn
Copy link
Member

di72nn commented Mar 31, 2020

Can somebody provide a couple of examples?

@ngosang
Copy link
Contributor Author

ngosang commented Apr 1, 2020

Most images are read properly, but I found one that doesn't.

https://www.elconfidencial.com/espana/2020-04-01/coronavirus-ultima-hora-covid19-fallecidos_2524247/

Start reading in this paragraph, you will hear not just the URL, also the HTML code, tags...

image

If you look at the source code it's a bit more complex than an img:

<a href="https://www.ecestaticos.com/file/bb9dda95798ab68ea963442112b32b18/1585730429-carta-admin-provisional-u-nica-de-rtve-01-04-20.pdf" class="img-link" target="_blank" rel="nofollow">
   <figure class="news-img-figure">
      <noscript>
         <p><img class="eclazy news-img-def" src="https://www.ecestaticos.com/image/clipping/585/d2dd4f749212b4be8ddba6b5ce1c5e51/pinche-aqui-para-consultar-la-carta-integra-a-rtve.jpg" alt="Pinche aquí para consultar la carta íntegra a RTVE" width="585" height="836" referrerpolicy="no-referrer" /></p>
      </noscript>
      <img class="news-img-def" alt="Pinche aquí para consultar la carta íntegra a RTVE" src="https://www.ecestaticos.com/image/clipping/585/d2dd4f749212b4be8ddba6b5ce1c5e51/pinche-aqui-para-consultar-la-carta-integra-a-rtve.jpg" referrerpolicy="no-referrer" width="585" height="836">
      <figcaption class="news-img-caption-def">Pinche aquí para consultar la carta íntegra a RTVE</figcaption>
   </figure>
</a>

Maybe we should remove all HTML code when reading (all the HTML tags).

I hove @ntnsndr can provide better examples.

@ntnsndr
Copy link

ntnsndr commented Apr 1, 2020

Yes, I've been looking for examples! Will post as I encounter them. Sorry for the delay. It's true that this happens less than I think it used to. But I was reminded of this the other day when my wife said, "I love it when your robot reads URLs."

@di72nn
Copy link
Member

di72nn commented Apr 2, 2020

That problem with <noscript> elements is unusual, but trivial to fix.
I also encountered the same problem with this article (near the very end).

However, it seems to me that <img> tags are not read at all (an accessibility issue).

@ngosang
Copy link
Contributor Author

ngosang commented Apr 2, 2020

However, it seems to me that tags are not read at all (an accessibility issue).

That should be easy to fix. Just add some code like this here => https://github.com/wallabag/android-app/pull/945/files#diff-db78bf95f5278b36d57b2bb1ace522c9R118

            } else if (element.nodeName === 'IMG') {
                if (element.hasAttribute("alt")) {
                    accumulatedText += "Image: " + element.getAttribute("alt");
                }
            }

NOTE: You have to translate the text "Image".

@ntnsndr
Copy link

ntnsndr commented Apr 3, 2020

I noticed the problem today on an image in a Google Doc (I can't share the URL because it was shared with me privately).

@ntnsndr
Copy link

ntnsndr commented Apr 19, 2020

Okay, I found an example of an image tag the TTS is reading: See this article, just before the author's byline at the very end.

@di72nn
Copy link
Member

di72nn commented Apr 19, 2020

Seems like another <noscript> tag. Should be fixed in #931.

@ntnsndr
Copy link

ntnsndr commented Jun 20, 2020

Another offender here. Looks like <noscript> again.

@di72nn
Copy link
Member

di72nn commented Jun 22, 2020

You probably want to check out the latest beta (APK, beta on Google Play, eventually on F-Droid) - it contains a lot of TTS-related changes (including the fix for the <noscript> tag).

@ngosang
Copy link
Contributor Author

ngosang commented Jun 22, 2020

I have been testing the code in the master branch for a while. It's really good. Thank you!

@ntnsndr
Copy link

ntnsndr commented Jun 22, 2020

Thanks! Yes, I'm on the F-Droid bandwagon.

@di72nn
Copy link
Member

di72nn commented Jul 11, 2020

2.4.0-beta.4 is available in F-Droid (it's not marked as "suggested", so you have to choose the version manually).

@di72nn
Copy link
Member

di72nn commented Aug 31, 2020

Reopen if you have new examples (with 2.4.0-beta.4+).

@di72nn di72nn closed this as completed Aug 31, 2020
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

6 participants