Quote:
Originally Posted by JSWolf
I'm using RC1 and I've found a bug. The plugin has removed a couple of images as unused images when they are being used. They are being used in the CSS. So (IMHO) the code for checking for unused images should also check CSS.
|
Hmm.
Okay, on the one hand, I agree with you that image removal ought to be checking the CSS, so at least from the conceptual angle, it's a bug. Not a new one, though, which leads me to two counterpoints.
First, not being new, fixing it is of necessity further down my list than squashing any bugs introduced in the new version.
Second, the help file description of the routine only claims to check HTML; it says nothing about going through the CSS:
Quote:
Looks for orphaned jpg, png and gif files that are not referred to from the html content pages and can be removed from the ePub. This can happen if for instance in Sigil you delete a page without removing the associated image(s).
|
(Emphasis mine.)
Finally, but by no means least significant: In studying modify.py and container.py, I see a way to search CSS files for given strings; the XPGT removal does that. However, I don't see a good way to scan the CSS for general classes (like "images"), and I'm not familiar enough with that routine to be confident that I could quickly hack it to properly check for relative paths - that is, to distinguish "../images/separator.jpg" in 1/css/styles.css from "../images/separator.jpg" in 2/stylesheet.css.
So, as much as I'd like to see this fixed, and as willing as I am to incorporate a patch from someone else in the community, I think that's going to have to wait for a later release.
Meanwhile, I have attached a new build which adds an explicit warning about this into the help file and incorporates a couple of other small fixes.
EDIT: Removed in favor of the final release version.