![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Oct 2020
Device: Kobo
|
![]()
I am dealing with an epub which is full of junk images (eg. Chapter titles, section breaks etc). Looking at the code using calibre code editor, I can see alt texts have been defined for every image.
For the love of God, how can I get rid of images in an epub and just use the alt texts instead. I prefer to have absolutely plain text in my epub, unless the images are essential or at least high quality (maps, illustration etc). I can not stand superfluous decorative images. So how do I go about doing it? Any method will do as long as the end result is achieved (epub to epub conversion, epub to docx conversion, modifying epub etc). Any help please. ![]() |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
A flip side of your request.
Are the Alt= even descriptive ? You may destroy meaning by deleting images. I've seen so many that when done are LAME to the point of worthless: eg "image", "line", "text" Screen readers USE Alt= so they should be meaningful descriptive: Map of World "Letter 'A' " (when dropcap is image of A) Mugshot of Author Your device needs to support (do not show images. Use Alt) Not being a Book setter, I am not sure what they do for a Scene break (image) ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
HTML code Code:
<h2 class="chapter">Chapter One</h2> Code:
h2 { font-size; large; margin-top: 1em; margin-bottom: 1em; text-align: center; font-weight: bold; text-indent: 0; } You replace the <img> code (as well as the <p> or <div>) with the code above and just change the text. |
|
![]() |
![]() |
![]() |
#4 | |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
If you are really, really lucky, you can just delete the image files in the file browser and the alt text will take over. But as others have said, it may not work in some e-reader, or it may be ugly, or just not work at all.
I usually find some combination of regex S&R and manual editing to do the job. Like maybe search for <img.*?> and replace with <h1 class="chapter">Chapter </h1>, and then go through and number the chapters manually (using replace all only if chapter heads are the only images). If you actually like the alt text available, you might get fancy enough to pull the text out of the "alt=" part of the <img... line with a regex expression and then stuff it into a replacement string. Depends on the coding you have how hard that would be. Last edited by retiredbiker; 10-20-2020 at 03:57 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Oct 2020
Device: Kobo
|
UPDATE:
Nope, not working guys. Lots of images have the alt text descript " "(literally empty). Nuking the images and reconverting just resulted in blank areas. The underlying code is pretty hideous too. Lots of <div></div> along with a media.css file to boot, where 50% of the code is probably dedicated just for making those drop caps work. ![]() I give up. Oh the joys of Vellum. (The book is built with vellum because the template is instantly identifiable). I am getting quite fed up with how indie authors are circle jerking around vellum. It's becoming abundantly clear that the tech illiteracy of the masses have real life consequences for tech literates too. I mean you can make a reasonably clean epub with vellum too, just turn off all decorations and don't use unnecessary images. The underlying code might still be ugly but at least calibre will be able to handle it pretty well. But nope, authors need to use each and every decorative feature of vellum along with custom image headers and such to make their book look "pretty". I am now painstakingly manually cleaning the epub using the PageEdit plugin of Sigil. Oh dear. Lesson learnt - I am never going to use any unnecessary image in my book. |
![]() |
![]() |
![]() |
#7 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
A simple dropcap uses 1 span style.
A fussy (author) dropcap simulates kerning. The padding-right varies with the shape of the letter. (old cold type count would just use 3: i, n, m widths) |
![]() |
![]() |
![]() |
#8 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
The problem is that for us to give you more help, we need to see the code. Is it OK for you to post the CSS and the first chapter alone with the images? You can make a copy of the ePub and delete everything but the CSS, the images, the cover HTML, and the first chapter HTML.Then you can attach it to a post in this thread and we can have a look at it. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't find new Copy Text in Tag shortcut (ctrl+alt+t) | rjwse@aol.com | Editor | 0 | 03-07-2020 03:04 PM |
Text is running over the images | melodyjane | Conversion | 0 | 08-01-2017 09:56 PM |
How to preseve alt text attributes for images during conversion | MartinHe | Conversion | 20 | 07-04-2017 07:37 AM |
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 |