<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>Clark,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>Ka-Map actually supports different image formats for
different layers. I also use JPEG for the same reasons, but I use GIF to render
the shapefile layers, to keep transparency, and because GIF compresses better
than PNG 8-bit. To use the custom image format, just put something like this in
your metadata</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>METADATA</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>imageformat "JPEG"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2># imageformat "GIF" # can use GIF</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2># imageformat "PNG24" # or JPEG</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>END</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>Be aware that for transparency with GIF to work, it must be
set as the IMAGETYPE in your mapfile (so that it is the default, and JPEG
becomes the custom format). For some reason, if IMAGETYPE is JPEG, then GIF's
become opaque, not transparent.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2>Jacob</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707341323-15052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ka-map-users-bounces@lists.maptools.org
[mailto:ka-map-users-bounces@lists.maptools.org] <B>On Behalf Of </B>Clark
Endrizzi<BR><B>Sent:</B> 16 May 2006 01:10<BR><B>To:</B>
ka-map-users@lists.maptools.org<BR><B>Subject:</B> [ka-Map-users] Simply
modification to allow compression settingsfor jpeg output<BR></FONT><BR></DIV>
<DIV></DIV>ON our site I think I'm going to switch to Jpeg output from
PNG24. I like PNG24 more without a doubt but the Jpeg images are about
1/4 the size (I'm using aerial imagery) so it will be a lot better
bandwidth-wise.<BR><BR>The problem I saw with using jpeg is it uses GD's
default JPEG settings which is about 75% quality. Shape files like
streets look terrible at this quality setting so I quickly added a little bit
to make it possible for the user to define their own compression. Here
is the code: <BR><BR>Config.php<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
case
"JPEG":<BR>
$GLOBALS['szMapImageFormat'] = 'JPEG'; //mapscript format name
<BR>
$GLOBALS['szImageQuality'] = '90'; //mapscript image quality, only applies
to jpeg
images<BR>
$GLOBALS['szMapImageCreateFunction'] = "imagecreatefromjpeg"; // appropriate
GD
function<BR>
$GLOBALS['szImageExtension'] = '.jpg'; //file
extension<BR>
$GLOBALS['szImageCreateFunction'] = "imagecreatetruecolor"; //or
imagecreatetruecolor if PNG24
...<BR>
$GLOBALS['szImageOutputFunction'] = "imagejpeg"; //or imagegif, imagejpeg
... <BR>
$GLOBALS['szImageHeader'] = 'image/jpeg'; //the content-type of the
image
<BR>
break;</BLOCKQUOTE>
<DIV><BR>tile.php<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
if($szImageQuality){<BR>
eval("$szImageOutputFunction( \$oTile,
'".$szTileImg."', '".$szImageQuality."');"); <BR>
}else{<BR>
eval("$szImageOutputFunction( \$oTile, '".$szTileImg."');");
<BR> }</BLOCKQUOTE>
<DIV><BR>The code is pretty self explanatory. I don't know if this
project would consider this addition but I think it's important for users to
be able to define image quality for jpegs.<BR><BR>BTW, I'm using version .2
(from CVS at that time) so I'm not sure if this has been added
since.<BR><BR>Thanks!<BR></DIV></DIV>-- <BR>Clark
Endrizzi<BR></BLOCKQUOTE></BODY></HTML>