Changing Image Resolution
Abe Gillespie
abe.gillespie at GMAIL.COM
Wed Dec 14 07:51:18 PST 2005
This is great for future enhancements ... but I'm trying to get at
least something working right now. Can anyone point me to any
resources / tutorials / examples of what I explained?
Thanks.
-Abe
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
> >
>
More information about the MapServer-users
mailing list