Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 07-03-2017, 09:21 AM   #1
MartinHe
Member
MartinHe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2017
Device: Kindle App
How to preseve alt text attributes for images during conversion

Dear all

I am preparing to publish my first eBook. I use Calibre to convert my docx document to azw3. So far, most of it works great. But I have to adjust the max-width of some pictures. And I want to do this automatically by a rule. So I don't want to go through all images each time I load a new version of the docx into Calibre.

In order to do this, I have to find a way how to identify the images. And one solution could be to give them alt text attributes that are distinctive. However, when I set one of the alt text tags of one picture to "abcd", it becomes alt="Image" in the converted eBook like every other picture, too. So I would like to know, how to preseve the original alt text attributes, so that I can use them for my purposes.

Best regards
Martin
MartinHe is offline   Reply With Quote
Old 07-03-2017, 09:50 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Readers use alt text, for example for read aloud functions. You should not use them for processing. Instead give your images distinctive file names when adding them to the docx.

Although, I have to say, as far as I know, calibre conversion does preserve alt text when converting from docx, from the descr property of the image in docx file.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-03-2017, 10:10 AM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
AMazon will not accept eBook converted using Calibre. You need to use Kindlegen or make an ePub and upload that.
JSWolf is offline   Reply With Quote
Old 07-03-2017, 10:13 AM   #4
MartinHe
Member
MartinHe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2017
Device: Kindle App
Dear Kovid

Thanks for the fast reply. I absolutely understand the original intention of the alt text attribute, but as all of the images get a alt="Image" attribute during conversion, it doesn't matter anyway.

I have read that the alt text should be preserved, but sadly it is not in my case. I have inserted all text attributes like "xyz" and "abcd". None of them can be found in the final azw3 file. I use Calibre 2.55 under Ubuntu.

Best regards
Martin
MartinHe is offline   Reply With Quote
Old 07-03-2017, 10:29 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That is an ancient version of calibre, update.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-03-2017, 12:17 PM   #6
MartinHe
Member
MartinHe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2017
Device: Kindle App
I will do that. By the way, that is still the version that is available in the current LTS version of Ubuntu.
MartinHe is offline   Reply With Quote
Old 07-03-2017, 12:19 PM   #7
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,498
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by MartinHe View Post
I use Calibre to convert my docx document to azw3. So far, most of it works great. But I have to adjust the max-width of some pictures.
You should be aware that the max-width property is not supported by kindle formats.
jhowell is offline   Reply With Quote
Old 07-03-2017, 12:27 PM   #8
MartinHe
Member
MartinHe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2017
Device: Kindle App
I have installed the new version. Looks nice. But still the image that has the alt text "abcd" gets alt="Image" during file conversion to azw3.
MartinHe is offline   Reply With Quote
Old 07-03-2017, 12:43 PM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by MartinHe View Post
I will do that. By the way, that is still the version that is available in the current LTS version of Ubuntu.
Kovid has no control over this disservice provided by the various Linux distros.

Use the (Linux) commandline given at the official Calibre download site .
You will need to use this again for each new release
theducks is offline   Reply With Quote
Old 07-03-2017, 01:27 PM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I can verify that even the very latest version of calibre doesn't use the alt-text property that's set using Microsoft Word. Even when converting from docx to epub, the alt-text property of the image tag becomes "Image." Regardless of what alt-text I define in Word.

I don't see a way to define the "description" property in Word 2007 (after only a cursory search) -- in case that's what calibre uses for alt-text. Just curious why Word's alt-text property wouldn't be used for this? Seems made to order.

EDIT: Never mind. I see that later versions of Word use the "description" property for its alt text. So it would seem Word versions earlier than 2010 might not be able to provide calibre with the property it's looking to use for alt-text.

EDIT2: I was wrong. I can see the "descr" property in the xml and it indeed contains the alt-text I defined in the docx document via Word 2007, the text of the descr property is just not finding its way into the converted document for some reason.

Last edited by DiapDealer; 07-03-2017 at 01:40 PM.
DiapDealer is offline   Reply With Quote
Old 07-03-2017, 02:50 PM   #11
tastyeng
Junior Member
tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.tastyeng ought to be getting tired of karma fortunes by now.
 
Posts: 8
Karma: 208038
Join Date: Mar 2016
Device: Too many to name
Quote:
Originally Posted by JSWolf View Post
AMazon will not accept eBook converted using Calibre. You need to use Kindlegen or make an ePub and upload that.
Is that a new policy? I know several people who, at least as recently as when I talked to them in 2016, were using Calibre to convert Word documents and then upload to KDP. I've always used Kindlegen though so I don't have any personal experience going that route.
tastyeng is offline   Reply With Quote
Old 07-03-2017, 03:33 PM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
More experimentation on this front:

When created with Word 2007, the alt-text does not survive a DOCX to EPUB conversion. "Image" is used for all alt-text image properties regardless of the alt-text that's defined via Word 2007.

If I open that same docx with LibreOffice Writer and immediately save and close it (no changes), then the alt-text defined in the DOCX document will appear in the alt-text properties of the resulting EPUB.

So at the very least, DOCX documents created with Word 2007 will not have the alt-text properties of their images carried over to subsequent calibre conversions. I don't have a newer version of Word to test.

Not sure what that means--other than, "don't use Word 2007 DOCX as your source format if you want alt-text properties to carry over to your calibre conversions".
DiapDealer is offline   Reply With Quote
Old 07-03-2017, 04:02 PM   #13
MartinHe
Member
MartinHe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2017
Device: Kindle App
Thanks DiapDealer! In fact I have only the 2007 version of M$ Word available. So, for me this does not work now. But still, it could be an improvement for later versions of Calibre
MartinHe is offline   Reply With Quote
Old 07-03-2017, 05:24 PM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by MartinHe View Post
I will do that. By the way, that is still the version that is available in the current LTS version of Ubuntu.
And you should ALWAYS get Calibre from the Calibre website. NEVER get Calibre from any other source. Calibre should have notified about an update and you should have clicked the link and gotten a newer version.

Last edited by JSWolf; 07-03-2017 at 05:27 PM.
JSWolf is offline   Reply With Quote
Old 07-03-2017, 06:17 PM   #15
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
And you should ALWAYS get Calibre from the Calibre website. NEVER get Calibre from any other source. Calibre should have notified about an update and you should have clicked the link and gotten a newer version.
That does not usually work in Ubuntu. Repo versions break that also
theducks is offline   Reply With Quote
Reply

Tags
alt text, calibre, conversion, identifier, picture


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Signature: table possible? Left and right text on same line? Wiki-Link with alt name? Cyberman tM Lounge 5 03-31-2014 02:05 PM
Alt Text in epub Lancelot ePub 3 09-11-2013 03:55 AM
Images linked, 'Align' and 'Width' attributes sebdea Kindle Formats 2 01-17-2012 08:16 AM
Images and text wrapping steveboyett Calibre 3 07-20-2010 08:26 PM
Image and text- images lost in conversion monkeywithscisso Calibre 3 01-14-2009 10:01 PM


All times are GMT -4. The time now is 09:16 AM.


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