Bug 8019 - Low aspect ratio images don't work well in documentation
Summary: Low aspect ratio images don't work well in documentation
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 4.14.0
Hardware: Other Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-08 12:23 CET by Tobias
Modified: 2022-11-11 17:25 CET (History)
0 users

See Also:
Acceptance Criteria:
* Images with arbitrarily low/high aspect ratios should scale neatly on the PDF page * PDF build extensions pertaining to image scaling should not produce a crash in corner cases


Attachments

Description Tobias cendio 2022-11-08 12:23:09 CET
If width is not explicitly set for images in the documentation, an implicit width of 80% page width is imposed for the PDF version (see doc/external/extensions/pdfimgsize.py), which will cause images with low aspect ratio to potentially cover several pages and may cause a crash.
Comment 2 Tobias cendio 2022-11-11 17:25:09 CET
An updated solution to this conundrum has been introduced in commit r39236. Since there seems to be an inconsistency in DPI assumptions, as in 72 vs 96, we apply an implicit scale of 3/4 on all SVGs lacking explicit width/height/scale. 

Looking at the function size_for_node() in https://github.com/rst2pdf/rst2pdf/blob/main/rst2pdf/image.py, it is not obvious why large SVGs that are scaled down prior to our 3/4 factor, are still rendered above 75% width. However, both large and smaller images appear fine in the resulting document, so this is sufficient for now.

Note You need to log in before you can comment on or make changes to this bug.