In Social Media, as on the internet in general, it has become widely normal to add descriptions (alt text) to images to aid visually impaired users.
But what, if we want to avoid typing them again and again, in case we want to reuse an image?
Luckily, our favourite image viewers, like GwenView or gThumb, can help with that: You can easily store image descriptions with your images (see picture), from where they can be copied and pasted into the description field when creating a social media post.
When downloading a file, which already has a description, from the internet, there is a useful add-on to major browsers, like FireFox and the Chrome family: âcopy alt textâ.
Unfortunately, the default behaviour of the cp command is not to copy these attributes. In order to do so, you need to add the option --preserve=all to the command.
Hello Mina,
Nice to hear from you again.
I do find that interesting because @Rosika and I have been
playing with adding images to markdown documents.
Markdown has a syntax like this
![Alt Text](path-to-image "Title")
The Title bit displays under the image, and the Alt Text bit
seems to be displayed if the image can not be displayed.
I just wonder whether this Alt Text in markdown is the same as the image descriptions you refer to.
Yours are extended file attributes so they move around with the image file.
If I copied a file with extended attributes into
markdown, I wonder what would happen?
I will try it.
Regards
Neville
Yes, the image description, Iâm referring to is the same thing as the Alt Text in Markdown, or, translated into HTML:
<img src="..." alt="...">
However, when uploading an image onto a website or into an app, most meta information is automatically stripped off, in order to protect your privacy, so no way to get it inserted automatically.
That seems to work against what I have been reading about accessibility.
Screen readers for visually impaired people are supposed to turn the Alt Text associated with an image into a voice.
How can they do that if the metadata gets stripped off when you try to load an image into a webpage?
Is that what you mean by accessibility not working properly?
Youâre right. The screen readers turn the description (alt text) into speech, but the stripping away of meta information makes it necessary to insert the text manually, either by typing or by copy and paste.
Here in this forum, which uses markdown, it looks like this:
On social media (say Mastodon, or X/Twitter) with an upload function, you click on some button, usually called âadd descriptionâ and get a text field to enter the alt text.
I am getting it now. I can add a description to any image with gwenview or gthumb, and it stores it using xattr.
Do you know how or where the a linux filesystem keeps the extended file attributes. This is different from camera information (Exif)⌠that is kept in the file.
The extended attributes are features of modern file systems like ownership and read/write/execute privileges. You find them e.g. in ext4 and NTFS, but not in old ones, like FAT.
The EXIF information, where e.g. gThumb stores the âalt textâ information, is part of many (but not all) image formats.
Both approaches have advantages and disadvantages.
Thank you Mina.
I must apologise for being a pain with questions.
You have opened my eyes to this vision impaired area, and this is part of the learning curve.
I have tried with gthumb. I can store a comment, and it goes in the Exif area, which, as you say , is in the file header. I have not found anything called âalt textâ in gthumb yet. Keep looking.
I have not found any way of creating an extended attribute. The functions getfattr() and setfattr() mentioned on the xattr() man page
do not seem to exist in my Void Linux.
OK I need to install something
[nevj@trinity ~]$ xbps-query -Rs attr
[*] attr-2.5.1_1 Extended attribute support library for AC...
[-] attr-devel-2.5.1_1 Extended attribute support library for AC...
[-] attr-progs-2.5.1_1 Extended attribute support library for AC..
I need attr-progs
# xbps-install attr-progs
OK , now I have a man page for getfattr() and setfattr()
Nothing there⌠you told me it would be censored if I downloaded the image.
So lets try and add an attribute
[nevj@trinity ~]$ setfattr -n alt -v "Juana Ines de la Cruz" /run/media/nevj/LinuxHome1/nevj/juana.jpeg
setfattr: /run/media/nevj/LinuxHome1/nevj/juana.jpeg: Operation not supported
[nevj@trinity ~]$
nevj@trinity:~
$ attr -s alt -V "Juana Ines de la Cruz" juana.jpeg
Attribute "alt" set to a 21 byte value for juana.jpeg:
Juana Ines de la Cruz
nevj@trinity:~
Your questions are not a pain at all. Just a year ago, I had no idea myself. It was the contact to blind and partially sighted people on social media which made me aware of accessibility issues.
This is, how we learn: We Listen to other people and then start our own journey.
Stop looking!
âAlt textâ is just colloquial speech for âimage descriptionâ. The origin of the term is the alt tag in HTML.
Until now, I hadnât tried to set extended attributes directly, I always did so via GwenView.
So, I tried and ran into the same issue as you (but found the solution). Have a look:
Rechner:~$ getfattr -d Pictures/Screenshot_20230616_143100.png
# file: Pictures/Screenshot_20230616_143100.png
user.xdg.comment="Screenshot of the directory view
of the GwenViewimage viewer.\012\012
On the right thumbnails of pictures of which one is
highlighted, on the right a pane with three tabs:
\012\012Folders, info. operations \012\012
The info tab is the one opened and there is a
text field for image description."
Rechner:~$ setfattr -n "test for Neville"
-v "This might work or not"
Pictures/Screenshot_20230616_143100.png
setfattr: Pictures/Screenshot_20230616_143100.png:
Operation not supported
Rechner:~$ setfattr -n user."test for Neville" -v "This might work or not" Pictures/Screenshot_20230616_143100.png
Rechner:~$ getfattr -d Pictures/Screenshot_20230616_143100.png
# file: Pictures/Screenshot_20230616_143100.png
user.test for Neville="This might work or not"
user.xdg.comment="Screenshot ... description."
See!? You have to prefix the attributesâ name with user.!
The author of the manual page could have mentioned that, I believe.
So the adding of the image description has worked, it seems.
However when looking at the âmodifiedâ picture in shotwell the additional tag isn´t displayed. It´s empty,
So I thought shotwell doesn´t support tags, but it does.
It has a âtagsâ option in the upper shelf and from there: âAdd Tagsâ and âModifiy Tagsâ.
Perhaps shotwell´s tags feature differs from the setfattr command in some way
What we donât know (yet) is, where Shotwell stores its tags.
It might be in the attributes (but surely, not in one called âwitchâ), it might be in the EXIF data, or it might be even in an internal database (my guess).
looking at the âmodifiedâ picture in shotwell the additional tag isn´t displayed. It´s empty,
Hi @Rosika , @Mina did not say that Gwenviw or gthumb could see extended attributes. I guess the same applies to Shotwell
Here is what Mina said
Luckily, our favourite image viewers, like GwenView or gThumb, can help with that: You can easily store image descriptions with your images (see picture), from where they can be copied and pasted into the description field when creating a social media post.
So the idea is you can store an image description in a tag or a comment in the image viewer, then copy/paste it into the alt text field when uploading an image.
It took me a long time to grasp this⌠I too expected the viewer to see the extended attribute. It may be able to, but we have not discovered how yet.
The extended attribute is really quite useless, because it will not automatically upload when you upload the image.
Mina did also say that there is a browser extension which will download alt text, but it stores it as an extended attribute, which is not very useful, at least we can not see how to use it yet.
I think this topic is a great example of how difficult it can be to get an idea over to other people who may not understand all of its aspects. None of us understood extended attributes, and it seems to be unusable anyway. We should thank @Mina for her patience.
I think, I might do a small introduction into this subject, covering the different aspects, we have discovered so far, as I see there are still a few confusions.
It doesnât really fit into ItsFoss, as it transcends operating systems and applications, so Iâm gonna put it somewhere and link it into this thread, then the bosses (Abhishek, Ankush, ???) can decide if they want to take it.
Good idea. It needs drawing together.
Rosika and I did something like that on another topic⌠we did it as a series of markdown documents⌠which we loaded into a topicâŚ
See here