Quote:
Originally Posted by philja
Which is essentially what I did. I hacked together a regex FIND:
<img\s+(alt="Image .+?")\s+(src="../Images/image\d+\.gif")\s+width="(\d+)%"\s*/>
[ this also worked <img\s+(alt="[^"]*")\s+(src="[^"]*")\s+width="(\d+)%"\s*/> ]
with a REPLACE:
<img class="w\3" \2 \1/>
[This put the alt entry at the end keeping it out of the way visually when checking images later.]
Since many of the images had width=50%, I started with an additional CSS class in the style sheet :
.w50 {height: auto;width: 50%}
and then did a find/replace one at a time. This was a little tedious but pretty quick. When I came to an image with a different width %, if I then decided it would be better to keep it at that width, I just created an additional CSS style entry.
Afterwards, I was curious to find out why all the image entries were not displayed as errors by the epubcheck plugin. So I redid the epub3 conversion and investigated. I also had a look at the log and saw that it had a line:
Code:
"message" : "Error while parsing file: value of attribute \"width\" is invalid; must be an integer",
"additionalLocations" : 50,
I think that if some indication of the total number of errors would be displayed by the epubcheck plugin, it would be helpful to those authors who don't know how to access the log.
|
You would solve the IMG problem by removing the width and replacing it with a class. Then all you would need to do is fix that one classes as needed. Plus, converting to ePub3 would work.