|
From: Pierre <pie...@gm...> - 2007-02-13 01:05:34
|
On 2/13/07, m sutton <mw...@us...> wrote: > > > ----- Original Message ----- > > From: "Ethan A Merritt" <merritt@u.washington.edu> > > To: gnu...@li... > > Subject: Re: dashed lines with GD [ was Re: symbol/color/line consistency in terminals] > > Date: Sun, 11 Feb 2007 21:44:45 -0800 > > > > > > On Sunday 11 February 2007 21:25, Daniel J Sebald wrote: > > > > > > > However, it would be nice to set DPI somehow through GD. > It > > > would simplify things when I import images into Word or > > > PowerPoint. Well, that isn't too difficult, is it? > > > > Actually, it is. > > > > The PNG standard does not provide a place to store dpi. > > Some apps store it in a comment record, but that is idiosynchratic, > > and anyhow gd does not (yet) support comment records in PNG. > > > > OK so it not DPI but its close. > > The PNG specification supports a chunk called pHYs which related pixels to phyiscal dimensions. > > LIBPNG has the following: > png_set_pHYs(png_ptr, info_ptr, res_x, res_y, > unit_type); > res_x - pixels/unit physical resolution > in x direction > res_y - pixels/unit physical resolution > in y direction > unit_type - PNG_RESOLUTION_UNKNOWN, > PNG_RESOLUTION_METER > > So it would appear the GDLIB could would need to a way to call png_set_pHYs. Then modify gd.trm to accept a resolution setting. > > Mike Sutton > > p.s. As a temporary workaround I run ImageMagick's convert with the -density option to set resolution. The DPI/resolution is a purely informative data. A pixel remains a pixel. A software can take care of it or not, applies its own, etc (I had all kind of troubles in pre-press while trusting this info too much). So I would take it with a grain of salt :) About GD and meta data, I would like to provide some bridges between GD and a (working) meta library with a permissive enough license. At the very least, if nothing exists, I will go with a GD specific implementation. --Pierre |