Changing Image Resolution

Abe Gillespie abe.gillespie at GMAIL.COM
Wed Dec 14 21:29:41 EST 2005


The displaying's not the problem.  You need the printer to print it
correctly.  The header in the PNG file is what controls the DPI (at
least as far as I can tell).

-Abe

On 12/14/05, Mark Wright <sparkymeister at gmail.com> wrote:
> Could you have mapserver create a 600x400 image and display it at 300x200?
>
>
> Mak
>
> On 12/14/05, David Bitner <osgis.lists at gmail.com> wrote:
> > In general, what would it take to add some parameters to the mapfile
> > that allow for better resolution control.  Right now I have mapscript
> > code that goes through and adjusts the sizes of all my symbols and
> > fonts (of course bitmap symbols wouldn't work) for different
> > resolutions, but I would love to see this as more meaningful
> > resolution parameters in the mapfile that could be controlled through
> > cgi.
> >
> > I would also love to see another setting that would use certain
> > resolutions (as above) at certain image sizes.  If you set this up
> > correctly, it would allow for better easy use of WMS layers in client
> > applications as while browsing the image on the screen it would use
> > the low res, but as soon as the client application makes a request for
> > a huge image, it would be able to tell that you were creating a
> > printout and could rescale all the symbols so that what you printed
> > would be the same as what you had on your screen.
> >
> >
> >
> > On 12/14/05, Abe Gillespie <abe.gillespie at gmail.com> wrote:
> > > I know it's impossible to change DPI on-the-fly within MapServer (it's
> > > set at compile time).  But I want to "fake" a higher resolution image
> > > within PHP.
> > >
> > > Let's just use PNG as an example.
> > >
> > > I assume there's a header in the PNG image that specifies its DPI so
> > > this info can be used by printers, image editors, etc.  So my idea is
> > > if I want a PNG with twice the resolution (from 72 to 144 DPI) is to
> > > simply adjust the width & height in MapServer and then edit the PNG's
> > > header in PHP.
> > >
> > > So, if I have a 300x200 pixel image, but I want to increase the DPI to
> > > 144:  First I'd change MapServer width & height:
> > >
> > > $map->setSize(600, 400);
> > >
> > > Then I'd render the image to disk, open the file up in PHP, and change
> > > the header with some binary file operations.
> > >
> > > Is my thinking correct here?  If so, are there any examples of binary
> > > file manipulation via PHP.  Are there any examples of the PNG's
> > > header?
> > >
> > > Thanks for the help.
> > > -Abe
> > >
> >
>
>
> --
> Have fun or die trying - but try not to actually die.
> http://www.AboveCalifornia.com
> Got Mac OS X? Get the AboveCalifornia Sherlock Channel:
> sherlock://www.AboveCalifornia.com/sherlock/SherlockChannel.xml?action=add
>



More information about the mapserver-users mailing list