Changing Image Resolution
David Bitner
osgis.lists at GMAIL.COM
Wed Dec 14 06:38:25 PST 2005
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