projects
/
mupdf.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e6905f
)
Bug 702522: Add resolution to output PNG files.
author
Robin Watts
<
[email protected]
>
Fri, 25 Sep 2020 16:18:24 +0000
(17:18 +0100)
committer
Robin Watts
<
[email protected]
>
Fri, 2 Oct 2020 10:38:26 +0000
(
03:38
-0700)
source/fitz/output-png.c
patch
|
blob
|
blame
|
history
diff --git
a/source/fitz/output-png.c
b/source/fitz/output-png.c
index 8016588a483053b6912a918a954a5ee0786281f1..60958dbae7ed6da695f46c36b91e0e41000a9308 100644
(file)
--- a/
source/fitz/output-png.c
+++ b/
source/fitz/output-png.c
@@
-171,6
+171,11
@@
png_write_header(fz_context *ctx, fz_band_writer *writer_, fz_colorspace *cs)
fz_write_data(ctx, out, pngsig, 8);
putchunk(ctx, out, "IHDR", head, 13);
+ big32(head+0, writer->super.xres * 100/2.54f + 0.5f);
+ big32(head+4, writer->super.yres * 100/2.54f + 0.5f);
+ head[8] = 1; /* metre */
+ putchunk(ctx, out, "pHYs", head, 9);
+
png_write_icc(ctx, writer, cs);
}