summaryrefslogtreecommitdiff
path: root/crates/typst-layout/src/image.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-layout/src/image.rs')
-rw-r--r--crates/typst-layout/src/image.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/typst-layout/src/image.rs b/crates/typst-layout/src/image.rs
index d963ea50..3e5b7d8b 100644
--- a/crates/typst-layout/src/image.rs
+++ b/crates/typst-layout/src/image.rs
@@ -95,6 +95,8 @@ pub fn layout_image(
} else {
// If neither is forced, take the natural image size at the image's
// DPI bounded by the available space.
+ //
+ // Division by DPI is fine since it's guaranteed to be positive.
let dpi = image.dpi().unwrap_or(Image::DEFAULT_DPI);
let natural = Axes::new(pxw, pxh).map(|v| Abs::inches(v / dpi));
Size::new(