Export: record slide resolution in PNG and JPEG pictures

A default export is 2 pixels per point. Without a resolution, Preview
treats those pixels as 72 dpi and the picture opens at twice the slide's
size. PNG pHYs and JPEG JFIF density now say scale times 72, so the
default is 144 dpi. Screenshots stay untagged.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nikita Rakitin
2026-10-14 05:35:37 +03:00
co-authored by Cursor
parent 457406a7a5
commit d04df05249
11 changed files with 208 additions and 18 deletions
+1 -1
View File
@@ -232,7 +232,7 @@ fn render_transition(args: &[String]) -> Result<(), String> {
let name = format!("{stem}-t{t:.3}.png");
p.with_file_name(name).to_string_lossy().into_owned()
};
std::fs::write(&path, img.to_png()).map_err(|e| format!("{path}: {e}"))?;
std::fs::write(&path, img.to_png_at(render::dpi_for_scale(opts.scale))).map_err(|e| format!("{path}: {e}"))?;
outln!("{path} ({}×{}) {} {} t={t}", img.width, img.height, tr.kind, tr.option);
}
Ok(())