wf49670 / ppgen

Post-processing generator for DP
6 stars 4 forks source link

Fix issue with .di where .il overrides too many <img> elements #65

Closed wf49670 closed 9 years ago

wf49670 commented 9 years ago

If any .il are in the file, ppgen generates CSS for img to set maxwidth to 100% and height to auto. That causes problems for drop-cap images, which should not be overridden.

This update makes ppgen generate CSS for .figcenter img, .figleft img, or .figright img instead, as appropriate for the images present in the source file.

wf49670 commented 9 years ago

Roger: Please review to make sure I properly understood how your method of generating CSS works; I've never had to change that before.

Also: I have only tested with centered illos, not with right- or left-aligned ones. Nor have I checked what happens in epub/mobi (though I made no epub- or mobi-specific changes as far as I know),

ghost commented 9 years ago

I will review what you've done before I do the merge into rfrank:develop from wf49670:develop. Thanks for flagging it.

ghost commented 9 years ago

Yes this looks correct. It was an error in the original, written before drop-caps were added. I'll merge and then comment in the DP thread.

wf49670 commented 9 years ago

On 11/18/2014 4:33 PM, rfrank wrote:

Yes this looks correct. It was an error in the original, written before drop-caps were added. I'll merge and then comment in the DP thread.

Thanks, Roger.

I discovered it only by accident, as I suddenly wondered why, if .di can accept width/height as a raw number (no % or em) things fall apart if someone does that with .il (where we warn if they don't include the unit). So I added a .il and all the drop-cap images went wonky. And then I realized that was perhaps the root cause of the problem mentioned in the forum.

I mention this, though, to point out that the width and height specifications for .di are inconsistent with those for .il. They work for .di because the problem with raw numbers for .il is that the value is used in other contexts than img tags, and that doesn't arise for .di. I don't think it's worth changing .di to make it consistent, but thought you might want to know.

Regards, Walt