Thread: Image upscale
View Single Post
Old 09-13-2023, 04:15 PM   #18
Vanguard3000
Groupie
Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.
 
Posts: 169
Karma: 474196
Join Date: Jan 2011
Location: Canada
Device: Kobo Libra 2
If you have the height, you could try and figure out how tall each "line" is, then make a series of classes like:

Code:
.img-2-lines {
height: 2em;
max-width:100%;
max-height:100%;
object-fit:contain;
}

.img-3-lines {
height: 3em;
max-width:100%;
max-height:100%;
object-fit:contain;
}

(etc.)
Then do a find & replace like:

Code:
Find: <p><img width="\d+" height="3\d+" src="(.*?)"/></p>
Replace: <p style="text-align:center;"><img class="img-3-lines" src="\1"/></p>
You'd have to "dial in" the height value as I doubt you'd have it so that each line would be roughly 100px. Also, if any of the images have whitespace around it you'd have to deal with that as well.

But as everyone is saying, you'd really need to manually go through each one to get an ideal solution, or just deal with some weird formatting. You can't get everything from nothing.
Vanguard3000 is offline   Reply With Quote