diff options
| author | Ralf Stephan <ralf@ark.in-berlin.de> | 2006-06-22 14:26:10 +0000 |
|---|---|---|
| committer | rwst <rwst@users.sourceforge.net> | 2006-06-22 14:26:10 +0000 |
| commit | 2bef43626ceb10288cf4e289dad406608c588eaf (patch) | |
| tree | 2068eaf3d22e88a66cd17bd8a5e107497660292e /src/helper/png-write.cpp | |
| parent | remove setDoc(), part of fix for #1509854 (diff) | |
| download | inkscape-2bef43626ceb10288cf4e289dad406608c588eaf.tar.gz inkscape-2bef43626ceb10288cf4e289dad406608c588eaf.zip | |
apply patch 1498946 by zbsz (fixes #1492545 "PNG resolution value export")
(bzr r1262)
Diffstat (limited to 'src/helper/png-write.cpp')
| -rw-r--r-- | src/helper/png-write.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index 21eca1efa..c90121860 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -53,18 +53,18 @@ sp_png_get_block_stripe (const guchar **rows, int row, int num_rows, void *data) } int -sp_png_write_rgba (const gchar *filename, const guchar *px, int width, int height, int rowstride) +sp_png_write_rgba (const gchar *filename, const guchar *px, int width, int height, double xdpi, double ydpi, int rowstride) { SPPNGBD bd; bd.px = px; bd.rowstride = rowstride; - return sp_png_write_rgba_striped (filename, width, height, sp_png_get_block_stripe, &bd); + return sp_png_write_rgba_striped (filename, width, height, xdpi, ydpi, sp_png_get_block_stripe, &bd); } int -sp_png_write_rgba_striped (const gchar *filename, int width, int height, +sp_png_write_rgba_striped (const gchar *filename, int width, int height, double xdpi, double ydpi, int (* get_rows) (const guchar **rows, int row, int num_rows, void *data), void *data) { @@ -151,6 +151,7 @@ sp_png_write_rgba_striped (const gchar *filename, int width, int height, /* other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs, */ /* note that if sRGB is present the cHRM chunk must be ignored * on read and must be written in accordance with the sRGB profile */ + png_set_pHYs(png_ptr, info_ptr, unsigned(xdpi / 0.0254 + 0.5), unsigned(ydpi / 0.0254 + 0.5), PNG_RESOLUTION_METER); /* Write the file header information. REQUIRED */ png_write_info(png_ptr, info_ptr); |
