Changing Image Resolution {Scanned}
Siki Zoltan
siki at AGT.BME.HU
Thu Dec 15 04:37:12 PST 2005
Hi,
You can forcee the browser to rescale your image, but it gives usually
ugly result.
In your map file (or URL) specify SIZE 600 400 and
in the html page insert
<img src="[img]" width=300 height=200>
BUT if you have scalebar and displayed scale (eg. [scale]) then it is not
a good idea to change the image resolution...
Why don't you ask mapserver to generate 300x200 image?
Or if you need both ask mapserver to generate two map image.
For example
<img scr="your_server/cgi-bin/mapserv?mapsize=600+400&......>
<img scr="your_server/cgi-bin/mapserv?mapsize=300+200&......>
Zoltan
On Wed, 14 Dec 2005, Mark Wright 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