View Single Post
Old 06-30-2025, 10:52 AM   #6
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,828
Karma: 6120478
Join Date: Nov 2009
Device: many
FWIW,
You can use Regex to capture all img tags and use a capture group to extract a file name.
A full book path would be better in case of duplicate files names with different images in different folders (eg. chapter1/figure1.png vs chapter2/figure1.png) but probably overkill.

Then looking up the extracted file name in your python dict (read in from csv once at the beginning) and adding in alt to create the replacement in Python Function Replace, should be easier than a full plugin and quite robust.

But to each their own approach. I replacement table could be a useful generic python function find replace tool to have in a users bag of tools.

Last edited by KevinH; 06-30-2025 at 12:05 PM.
KevinH is offline   Reply With Quote