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 05-16-2017, 11:12 AM   #1
Gary Friedman
Member
Gary Friedman began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Oct 2014
Device: none
Search only for images inside tables...

Hi. I have a complex layout book I imported from .docx. I want to do a search / replace of all images that are inside tables and set the width to 100%. For example, I want to change the image found in this table:

<table width="100%">
<tbody class="calibre10"><tr class="calibre11">
<td class="td_116"><p class="block_3"><img alt="Image" src="images/image448.png" class="calibre446"/></p></td>
</tr>
<tr class="calibre11">
<td class="td_116"><div class="frame_1"><p class="block_14"><span class="text_17">Figure 15-21</span><i class="calibre13"><span class="calibre2">: </span></i><i class="calibre13">Newer cards are essential to use these camera’s latest video modes</i></p></div></td>
</tr>
</tbody></table>

to this:

<table width="100%">
<tbody class="calibre10"><tr class="calibre11">
<td class="td_116"><p class="block_3"><img alt="Image" src="images/image448.png" width="100%"/></p></td>
</tr>
<tr class="calibre11">
<td class="td_116"><div class="frame_1"><p class="block_14"><span class="text_17">Figure 15-21</span><i class="calibre13"><span class="calibre2">: </span></i><i class="calibre13">Newer cards are essential to use these camera’s latest video modes</i></p></div></td>
</tr>
</tbody></table>

(Here I just substituted class="calibre446" with width="100%".) My document has many other images that are not contained in tables whose size I don't want to touch. Is there an easy way of doing this?

Many thanks! GF
Gary Friedman is offline   Reply With Quote
Old 05-16-2017, 03:31 PM   #2
Gary Friedman
Member
Gary Friedman began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Oct 2014
Device: none
I should point out that you just can't search for

<table width="100%">((.|\n)*?)src=(.*?)class=(.*)/>(.*?)Figure((.|\n)*?)/table>

because it will find an in-line graphic between two tables that don't have images.
Gary Friedman is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Float images & tables? Phssthpok ePub 35 09-26-2015 06:44 AM
A problem with images inside tables RbnJrg ePub 2 10-28-2013 09:09 PM
TOC links inside tables in epub don't translate in mobi wannabee Calibre 1 01-20-2011 01:13 AM


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


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