View Single Post
Old 06-06-2019, 04:10 AM   #11
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by stumped View Post
so I have a book structured like this - where image000r says Chapter 1...
each chapter starts with a h1 tagged image but no text:
<h1 class="calibre10" id="calibre_pb_12"> <a id="_Toc511571660"><img src="../Images/00005.jpeg" alt="" class="calibre11"/></a> </h1>
the next chapter will use images/0006 for chapter 2 etc
One thing that makes code less cryptic is to rename the images to something meaningful.
If they are at least numbered in sequence, you can select all the chapter head images in the file list and rename as "Chapter_1" and they will be named in sequence from that. You might use "Chapter_01" to make them sort correctly after renaming if more than 9 chapters.
You could then use a simple regex to grab the image name and insert a "title=\1" tag; and/or "alt=\1" tag for each heading.

If the image names are random, you can use Tools -- Reports -- Images to see them all together and rename them manually; obviously a bit more tedious.

Often though these image titles are not worth the hassle and the bloat they bring to the file. You can replace them with text and maybe a common ornament.

Or if I keep them, I run them through Irfanview's batch convert and convert them from 16 million colour jpegs (as they usually are in retail books) to 4 colour GIFs, usually reducing them by 90% in size; adding a sharpen maybe. Usually indistinguishable, sometimes better, than original.

Last edited by AlanHK; 06-06-2019 at 04:17 AM.
AlanHK is offline   Reply With Quote