Thanks guys. Apparently my solution was completely worthless. I had no idea you could do different formats per layer. That's perfect.<br><br>Thanks,<br>Clark<br><br><div><span class="gmail_quote">On 5/15/06, <b class="gmail_sendername">
Paul Spencer</b> <<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Clark,<br><br>you can also just declare an appropriate outputformat object in your<br>map file named JPEG. tile.php simply selects the output format. If<br>you don't have one defined in your map file, you get the defaults.
<br>If you do ... :)<br><br>Cheers<br><br>Paul<br><br>On 15-May-06, at 1:09 PM, Clark Endrizzi wrote:<br><br>> ON our site I think I'm going to switch to Jpeg output from PNG24.<br>> I like PNG24 more without a doubt but the Jpeg images are about 1/4
<br>> the size (I'm using aerial imagery) so it will be a lot better<br>> bandwidth-wise.<br>><br>> The problem I saw with using jpeg is it uses GD's default JPEG<br>> settings which is about 75% quality. Shape files like streets look
<br>> terrible at this quality setting so I quickly added a little bit to<br>> make it possible for the user to define their own compression.<br>> Here is the code:<br>><br>> Config.php<br>> case "JPEG":
<br>> $GLOBALS['szMapImageFormat'] = 'JPEG'; //mapscript<br>> format name<br>> $GLOBALS['szImageQuality'] = '90'; //mapscript image<br>> quality, only applies to jpeg images<br>> $GLOBALS['szMapImageCreateFunction'] =
<br>> "imagecreatefromjpeg"; // appropriate GD function<br>> $GLOBALS['szImageExtension'] = '.jpg'; //file extension<br>> $GLOBALS['szImageCreateFunction'] =<br>> "imagecreatetruecolor"; //or imagecreatetruecolor if PNG24 ...
<br>> $GLOBALS['szImageOutputFunction'] = "imagejpeg"; //or<br>> imagegif, imagejpeg ...<br>> $GLOBALS['szImageHeader'] = 'image/jpeg'; //the content-<br>> type of the image<br>
> break;<br>><br>> tile.php<br>> if($szImageQuality){<br>> eval("$szImageOutputFunction( \$oTile, '".<br>> $szTileImg."', '".$szImageQuality."');");
<br>> }else{<br>> eval("$szImageOutputFunction( \$oTile, '".<br>> $szTileImg."');");<br>> }<br>><br>> The code is pretty self explanatory. I don't know if this project
<br>> would consider this addition but I think it's important for users<br>> 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<br>> if this has been added since.
<br>><br>> Thanks!<br>> --<br>> Clark Endrizzi<br>> _______________________________________________<br>> ka-Map-users mailing list<br>> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org
</a><br>> <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br><br>+-----------------------------------------------------------------+<br>|Paul Spencer
<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a> |<br>+-----------------------------------------------------------------+<br>|Applications & Software Development |<br>
|DM Solutions Group Inc <a href="http://www.dmsolutions.ca/|">http://www.dmsolutions.ca/|</a><br>+-----------------------------------------------------------------+<br><br><br><br><br></blockquote></div><br>
<br clear="all"><br>-- <br>Clark Endrizzi<br>