pressbooks-book
pressbooks-book copied to clipboard
EPUB: Left- and right-aligned small images are larger than expected
Description
Left- and right-aligned small images are scaled up to 50% of page width in EPUB exports. We should investigate and find a way of resolving this issue.
Steps to Reproduce
- Insert small images (less than 50% of page width), and align them left and right.
Expected behavior: Left- and right-aligned small images appear at their intrinsic size.
Actual behavior: Left- and right-aligned images are never less than 50% of page width.
Reproducible, Buckram. The image in the screenshot below should be a thumbnail, but it's so blown up that it's blurry even before the ebook media quality has been manually decreased.
Example: https://tinytinyimage.textopress.com/
Image width appears to be set to 100% generally and then downsized to 50% for floated images: https://github.com/pressbooks/buckram/blob/5721a4a1b8dcb9cf7e7fa743d3ac5a9a44b4d885/assets/styles/components/media/_images.scss#L64-L85. Not sure why. Git blame offers little context. @greatislander do you have any backstory on this?
Related to https://github.com/pressbooks/pressbooks-book/issues/850