Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-14-2024, 10:47 AM   #1
oston
Connoisseur
oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 2138296
Join Date: Nov 2016
Device: ipad, Kindle Scribe, Kobo Libra 2
Question about alt-text in Access-Aide

In the "Update Alt for each image" page in Access-Aide, where does the plugin get the alt-text that had already been entered for images. Is it only from the html code for the image? If the image already has alt-text in its metadata, would Access-Aide be able to pick that up.

I have about 50-60 images for an ebook that I am working on and they have alt-text entries in the Alt-text (Accessibility) field. It would be great if Access-Aide could pick that up. At the moment it looks like it will be necessary to copy and paste the text into the Update-Alt page.

Thanks
Jim
oston is offline   Reply With Quote
Old 05-14-2024, 11:30 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
AccessAide parses each img tag to obtain the current alt= attribute value and uses that to initialize the alternative text value. That attribute has long been the correct one for accessibility purposes.

So what other accessibility field are you talking about exactly. Please provide an example straight from an xhtml file.

Some images contain internal metadata but that is inconsistently filled and not used.
KevinH is offline   Reply With Quote
Advert
Old 05-14-2024, 12:18 PM   #3
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 782
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
@KevinH:
https://cogdogblog.com/2022/11/diggi...mage-metadata/
BeckyEbook is online now   Reply With Quote
Old 05-14-2024, 12:22 PM   #4
oston
Connoisseur
oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 2138296
Join Date: Nov 2016
Device: ipad, Kindle Scribe, Kobo Libra 2
Thanks for the information, Kevin.

The accessibility (alt-text) field is in the internal metadata of these images, so I cannot give an example from an xhtml file.

This is the first time I've seen this in the internal metadata of an image file. I saw it when I was going to enter caption text in the Description Field of the images.

It might be that more people are paying attention to providing alt-text for their images and putting this into the meta-data is a good place to put it.

But if access-aide does not look there for alt-text information, no worries, I can copy and paste into the Access-Aide field. I was expecting to have to write the alt-text myself, so copying and pasting is less work.
Thanks again.
Jim
oston is offline   Reply With Quote
Old 05-14-2024, 12:34 PM   #5
oston
Connoisseur
oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 2138296
Join Date: Nov 2016
Device: ipad, Kindle Scribe, Kobo Libra 2
Quote:
Originally Posted by BeckyEbook View Post
Many thanks for this Becky. There's obviously a lot more to this than I expected. I assumed there were already something like a phptoolkit that could access such metadata.
oston is offline   Reply With Quote
Advert
Old 05-14-2024, 03:31 PM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
It might be possible to extract this information with the Pillow Python library if it's not an HEIF or AVIF image.
Can you attach a sample image that has this information?
Doitsu is offline   Reply With Quote
Old 05-14-2024, 03:46 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,487
Karma: 156983616
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Doitsu View Post
It might be possible to extract this information with the Pillow Python library if it's not an HEIF or AVIF image.
Can you attach a sample image that has this information?
I tried the sample image from the CogDogBlog link that @BeckyEbook posted. It's link is: https://iptc.org/std/photometadata/e...-Std2022.1.jpg.

ExifData.com recommended by CogDogBlog seems to be down but trying jimpl.com, viewing all metadata, it showed the alt text as:

Code:
AltTextAccessibility 	This is the Alt Text description to support accessibility in 2022.1
DNSB is offline   Reply With Quote
Old 05-14-2024, 03:58 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Interesting ... if Pillow can extract the AltTextAccessibility field from the image Metadata, I could certainly modify AccessAide to read it if it exists and use it to initialize the alt attribute value.

So @Doitsu, any luck using a recent Pillow to extract it?
KevinH is offline   Reply With Quote
Old 05-14-2024, 04:56 PM   #9
oston
Connoisseur
oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 2138296
Join Date: Nov 2016
Device: ipad, Kindle Scribe, Kobo Libra 2
Quote:
Originally Posted by Doitsu View Post
It might be possible to extract this information with the Pillow Python library if it's not an HEIF or AVIF image.
Can you attach a sample image that has this information?
I've attached a couple of image files with alt-text entries.
Attached Thumbnails
Click image for larger version

Name:	Image1254.jpg
Views:	120
Size:	76.5 KB
ID:	208275   Click image for larger version

Name:	Image1219.jpg
Views:	118
Size:	90.1 KB
ID:	208276  
oston is offline   Reply With Quote
Old 05-14-2024, 05:32 PM   #10
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 782
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
Here code:

Code:
import exiftool

with exiftool.ExifTool() as et:
    alt_text_from_exif = et.execute("-XMP:Alt Text Accessibility", "test.jpg")
    alt_text_from_exif = alt_text_from_exif.replace('[XMP]           Alt Text Accessibility          : ', '')
    print(alt_text_from_exif)
For image https://www.mobileread.com/forums/at...5&d=1715716506
result: A monk, holding a stick in his left hand and a bowl in his right hand, stands in front of a crowd of peopple.
BeckyEbook is online now   Reply With Quote
Old 05-14-2024, 05:49 PM   #11
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Is the exiftool part of Pillow? If not, I would prefer to use something guaranteed to work in our internal python internal to Sigil without having to add anything. Unless exiftool is standalone and in pure python?
KevinH is offline   Reply With Quote
Old 05-14-2024, 05:50 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Any other metadata fields that might indicate the language used for this alt text? It it guaranteed to be utf-8 encoded?
KevinH is offline   Reply With Quote
Old 05-14-2024, 05:51 PM   #13
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
So @Doitsu, any luck using a recent Pillow to extract it?
Apparently, AltTextAccessibility is an Exiv2 metadata entry. The closest EXIF equivalent is ImageDescription, which Pillow supports. Theoretically, Pillow is also supposed to support XML metadata via getxmp(), but I couldn't get the sample code to work.

The sample image referred to by BeckyEbook and DNSB contains the following metadata as plain text:
Code:
 <Iptc4xmpCore:AltTextAccessibility>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>This is the Alt Text description to support accessibility in 2022.1</rdf:li>
    <rdf:li xml:lang='en'>This is the Alt Text description to support accessibility in 2022.1</rdf:li>
   </rdf:Alt>
  </Iptc4xmpCore:AltTextAccessibility>
The sample image provided by the OP only contains an <rdf:li xml:lang="x-default"> entry.

Some StackOverflow users recommended searching for XMP metdata as text and parsing it with bs4.
Doitsu is offline   Reply With Quote
Old 05-14-2024, 06:08 PM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Doitsu View Post
Apparently, AltTextAccessibility is an Exiv2 metadata entry. The closest EXIF equivalent is ImageDescription, which Pillow supports. Theoretically, Pillow is also supposed to support XML metadata via getxmp(), but I couldn't get the sample code to work.

The sample image referred to by BeckyEbook and DNSB contains the following metadata as plain text:
Code:
 <Iptc4xmpCore:AltTextAccessibility>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>This is the Alt Text description to support accessibility in 2022.1</rdf:li>
    <rdf:li xml:lang='en'>This is the Alt Text description to support accessibility in 2022.1</rdf:li>
   </rdf:Alt>
  </Iptc4xmpCore:AltTextAccessibility>
The sample image provided by the OP only contains an <rdf:li xml:lang="x-default"> entry.

Some StackOverflow users recommended searching for XMP metdata as text and parsing it with bs4.
That is an idea. I will read up on that.
KevinH is offline   Reply With Quote
Old 05-15-2024, 10:46 AM   #15
oston
Connoisseur
oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.oston ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 2138296
Join Date: Nov 2016
Device: ipad, Kindle Scribe, Kobo Libra 2
Thanks for all these helpful posts. They prompted me to look at metadata more deeply.
I first saw the alt-text entries for this set of 53 images while looking at the metadata in Bridge. But when I looked at the images in Photoshop, the entries that were in alt-text (Accessibility) in Bridge were in Extended Description in Photoshop.

CORRECTION.
Photoshop DOES display the same alt-text metadata as Bridge and Photomechanic. There was an entry error in the two files I happened to be looking at in Photoshop. The alt-text had been entered into the wrong field.

But in PhotoMechanic, a widely used program for managing image metadata, the alt-text entry agrees with the Bridge format. PhotoMechanic gives me a lot of control over the metadata of the images. It's over 10 years since I used PM, so I'm very rusty. But if more metadata variations are needed, things might come back fairly quickly.

Last edited by oston; 05-16-2024 at 09:55 AM.
oston is offline   Reply With Quote
Reply

Tags
access-aide, alt text


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] Access-Aide - help improve epub accessibility KevinH Plugins 147 10-15-2024 11:25 AM
Bug: splitting pages after using Access Aide oston Sigil 4 04-08-2024 08:59 AM
[Editor Plugins] Access Aide wolf123 Plugins 5 07-08-2023 02:10 PM
access-aide failure oston Sigil 5 06-27-2023 04:42 PM
Alt Text in epub Lancelot ePub 3 09-11-2013 04:55 AM


All times are GMT -4. The time now is 03:20 PM.


MobileRead.com is a privately owned, operated and funded community.