[mapserver-commits] r8721 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Mon Mar 9 15:09:55 EDT 2009
Author: aboudreault
Date: 2009-03-09 15:09:55 -0400 (Mon, 09 Mar 2009)
New Revision: 8721
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/configure
trunk/mapserver/configure.in
trunk/mapserver/mapagg.cpp
trunk/mapserver/mapdraw.c
trunk/mapserver/mapgd.c
trunk/mapserver/mapimagemap.c
trunk/mapserver/maplegend.c
trunk/mapserver/mappdf.c
trunk/mapserver/mapresample.c
trunk/mapserver/mapscale.c
trunk/mapserver/mapserv.c
trunk/mapserver/mapserver.h
trunk/mapserver/mapswf.c
trunk/mapserver/maputil.c
trunk/mapserver/mapwcs.c
Log:
Added resolution writing in image files (#2891)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/HISTORY.TXT 2009-03-09 19:09:55 UTC (rev 8721)
@@ -11,6 +11,9 @@
Current Version (SVN trunk):
----------------------------
+
+- Added resolution writing in image files (#2891)
+
- Refactor legend icon drawing (remove renderer specific versions)
Add label styling or markers for annotation layer legend icons (#2917)
Modified: trunk/mapserver/configure
===================================================================
--- trunk/mapserver/configure 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/configure 2009-03-09 19:09:55 UTC (rev 8721)
@@ -7403,6 +7403,79 @@
GD_DEF="$GD_DEF -DUSE_GD_FT"
fi
+ GD_RESOLUTION_SUPPORT=no
+ as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageSetResolution" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for gdImageSetResolution in -l$GD_CHECKLIB" >&5
+echo $ECHO_N "checking for gdImageSetResolution in -l$GD_CHECKLIB... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gdImageSetResolution ();
+int
+main ()
+{
+return gdImageSetResolution ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Lib=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ GD_RESOLUTION_SUPPORT=yes
+fi
+
+
+ if test "$GD_RESOLUTION_SUPPORT" = "yes"; then
+ GD_DEF="$GD_DEF -DUSE_GD_RESOLUTION"
+ fi
+
as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageOpenPolygon" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageOpenPolygon in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageOpenPolygon in -l$GD_CHECKLIB... $ECHO_C" >&6; }
@@ -8209,6 +8282,79 @@
fi
+ GD_RESOLUTION_SUPPORT=no
+ as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageSetResolution" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for gdImageSetResolution in -l$GD_CHECKLIB" >&5
+echo $ECHO_N "checking for gdImageSetResolution in -l$GD_CHECKLIB... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gdImageSetResolution ();
+int
+main ()
+{
+return gdImageSetResolution ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Lib=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ GD_RESOLUTION_SUPPORT=yes
+fi
+
+
+ if test "$GD_RESOLUTION_SUPPORT" = "yes"; then
+ GD_DEF="$GD_DEF -DUSE_GD_RESOLUTION"
+ fi
+
if test -n "$GD_DEF" ; then
GD_LIB="-lgd $GD_LIB"
{ echo "$as_me:$LINENO: result: using GD ($GD_DEF) from system libs." >&5
Modified: trunk/mapserver/configure.in
===================================================================
--- trunk/mapserver/configure.in 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/configure.in 2009-03-09 19:09:55 UTC (rev 8721)
@@ -649,6 +649,14 @@
GD_DEF="$GD_DEF -DUSE_GD_FT"
fi
+ dnl check for Resolution support
+ GD_RESOLUTION_SUPPORT=no
+ AC_CHECK_LIB($GD_CHECKLIB, gdImageSetResolution, GD_RESOLUTION_SUPPORT=yes,, $GD_STATIC $GD_LIB $GD_XTRA_LIBS)
+
+ if test "$GD_RESOLUTION_SUPPORT" = "yes"; then
+ GD_DEF="$GD_DEF -DUSE_GD_RESOLUTION"
+ fi
+
dnl check for gdImageOpenPolygon (means GD version 2.0.29 or higher)
AC_CHECK_LIB($GD_CHECKLIB, gdImageOpenPolygon, GD_DEF="$GD_DEF -DGD_HAS_FTEX_XSHOW",, $GD_STATIC $GD_LIB $GD_XTRA_LIBS)
@@ -692,6 +700,14 @@
dnl getter functions.
AC_CHECK_LIB(gd, gdFontGetTiny, GD_DEF="$GD_DEF -DGD_HAS_GETBITMAPFONTS",, $GD_LIB $GD_XTRA_LIBS)
+ dnl check for Resolution support
+ GD_RESOLUTION_SUPPORT=no
+ AC_CHECK_LIB($GD_CHECKLIB, gdImageSetResolution, GD_RESOLUTION_SUPPORT=yes,, $GD_STATIC $GD_LIB $GD_XTRA_LIBS)
+
+ if test "$GD_RESOLUTION_SUPPORT" = "yes"; then
+ GD_DEF="$GD_DEF -DUSE_GD_RESOLUTION"
+ fi
+
if test -n "$GD_DEF" ; then
GD_LIB="-lgd $GD_LIB"
AC_MSG_RESULT([ using GD ($GD_DEF) from system libs.])
Modified: trunk/mapserver/mapagg.cpp
===================================================================
--- trunk/mapserver/mapagg.cpp 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapagg.cpp 2009-03-09 19:09:55 UTC (rev 8721)
@@ -871,7 +871,7 @@
// Returns a pointer to a newly created imageObj structure.
// a pointer to the AGG renderer is stored in the imageObj, used for caching
// ----------------------------------------------------------------------
-imageObj *msImageCreateAGG(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl)
+imageObj *msImageCreateAGG(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, unsigned int resolution)
{
imageObj *pNewImage = NULL;
@@ -880,7 +880,7 @@
return NULL;
}
- pNewImage = msImageCreateGD(width, height, format, imagepath, imageurl);
+ pNewImage = msImageCreateGD(width, height, format, imagepath, imageurl, resolution);
if(!pNewImage)
return pNewImage;
@@ -916,6 +916,10 @@
agg::rgba8 bc = getAGGColor(background,100);
ren->clear(bc);
}
+#ifdef USE_GD_RESOLUTION
+ /* Set the resolution */
+ gdImageSetResolution(image->img.gd, image->resolution, image->resolution);
+#endif
image->buffer_format=MS_RENDER_WITH_AGG;
/*
msImageInitGD(image, background);
Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapdraw.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -150,7 +150,7 @@
else if( MS_RENDERER_GD(map->outputformat) )
{
image = msImageCreateGD(map->width, map->height, map->outputformat,
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
if( image != NULL ) msImageInitGD( image, &map->imagecolor );
msPreAllocateColorsGD(image, map);
}
@@ -158,14 +158,14 @@
else if( MS_RENDERER_AGG(map->outputformat) )
{
image = msImageCreateAGG(map->width, map->height, map->outputformat,
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
if( image != NULL ) msImageInitAGG( image, &map->imagecolor );
}
#endif
else if( MS_RENDERER_IMAGEMAP(map->outputformat) )
{
image = msImageCreateIM(map->width, map->height, map->outputformat,
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
if( image != NULL ) msImageInitIM( image );
}
else if( MS_RENDERER_RAWDATA(map->outputformat) )
@@ -674,7 +674,7 @@
if(layer->opacity > 0 && layer->opacity < 100) {
msApplyOutputFormat(&transFormat, image->format, MS_TRUE, MS_NOOVERRIDE, MS_NOOVERRIDE);
- image_draw = msImageCreateGD( image->width, image->height, transFormat, image->imagepath, image->imageurl );
+ image_draw = msImageCreateGD( image->width, image->height, transFormat, image->imagepath, image->imageurl, map->resolution );
if(!image_draw) {
msSetError(MS_GDERR, "Unable to initialize image.", "msDrawLayer()");
return(MS_FAILURE);
@@ -700,7 +700,7 @@
if(layer->opacity > 0 && layer->opacity < 100) {
msApplyOutputFormat(&transFormat, image->format, MS_TRUE, MS_NOOVERRIDE, MS_NOOVERRIDE);
- image_draw = msImageCreateAGG(image->width, image->height, transFormat, image->imagepath, image->imageurl);
+ image_draw = msImageCreateAGG(image->width, image->height, transFormat, image->imagepath, image->imageurl, map->resolution);
if(!image_draw) {
msSetError(MS_GDERR, "Unable to initialize image.", "msDrawLayer()");
return(MS_FAILURE);
Modified: trunk/mapserver/mapgd.c
===================================================================
--- trunk/mapserver/mapgd.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapgd.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -269,7 +269,7 @@
* Utility function to create a GD image. Returns
* a pointer to an imageObj structure.
*/
-imageObj *msImageCreateGD(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl)
+imageObj *msImageCreateGD(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, unsigned int resolution)
{
imageObj *image;
@@ -297,7 +297,8 @@
image->height = height;
image->imagepath = NULL;
image->imageurl = NULL;
-
+ image->resolution = resolution;
+
if(imagepath) image->imagepath = strdup(imagepath);
if(imageurl) image->imageurl = strdup(imageurl);
@@ -318,6 +319,11 @@
void msImageInitGD( imageObj *image, colorObj *background )
{
+#ifdef USE_GD_RESOLUTION
+ /* Set the resolution */
+ gdImageSetResolution(image->img.gd, image->resolution, image->resolution);
+#endif
+
if(image->format->imagemode == MS_IMAGEMODE_PC256) {
gdImageColorAllocate(image->img.gd, background->red, background->green, background->blue);
return;
@@ -379,6 +385,11 @@
image->imageurl = NULL;
image->width = gdImageSX(img);
image->height = gdImageSY(img);
+#ifdef USE_GD_RESOLUTION
+ image->resolution = gdImageResolutionX(img);
+#else
+ image->resolution = 72;
+#endif
/* Create an outputFormatObj for the format. */
image->format = msCreateDefaultOutputFormat( NULL, driver );
Modified: trunk/mapserver/mapimagemap.c
===================================================================
--- trunk/mapserver/mapimagemap.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapimagemap.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -293,7 +293,7 @@
* a pointer to an imageObj structure.
*/
imageObj *msImageCreateIM(int width, int height, outputFormatObj *format,
- char *imagepath, char *imageurl)
+ char *imagepath, char *imageurl, unsigned int resolution)
{
imageObj *image=NULL;
if (setvbuf(stdout, NULL, _IONBF , 0)){
@@ -330,6 +330,8 @@
image->height = height;
image->imagepath = NULL;
image->imageurl = NULL;
+ image->resolution = resolution;
+
if( strcasecmp("ON",msGetOutputFormatOption( format, "DXF", "OFF" )) == 0){
dxf = 1;
im_iprintf(&layerStr, " 2\nLAYER\n 70\n 10\n");
Modified: trunk/mapserver/maplegend.c
===================================================================
--- trunk/mapserver/maplegend.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/maplegend.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -203,10 +203,10 @@
/* create image */
#ifdef USE_AGG
if(MS_RENDERER_AGG(map->outputformat))
- image = msImageCreateAGG(width, height, map->outputformat, map->web.imagepath, map->web.imageurl);
+ image = msImageCreateAGG(width, height, map->outputformat, map->web.imagepath, map->web.imageurl, map->resolution);
else
#endif
- image = msImageCreateGD(width, height, map->outputformat, map->web.imagepath, map->web.imageurl);
+ image = msImageCreateGD(width, height, map->outputformat, map->web.imagepath, map->web.imageurl, map->resolution);
/* drop this reference to output format */
msApplyOutputFormat( &format, NULL, MS_NOOVERRIDE, MS_NOOVERRIDE, MS_NOOVERRIDE );
@@ -453,10 +453,10 @@
/* initialize the legend image */
#ifdef USE_AGG
if(MS_RENDERER_AGG(map->outputformat))
- image = msImageCreateAGG(size_x, size_y, format, map->web.imagepath, map->web.imageurl);
+ image = msImageCreateAGG(size_x, size_y, format, map->web.imagepath, map->web.imageurl, map->resolution);
else
#endif
- image = msImageCreateGD(size_x, size_y, format, map->web.imagepath, map->web.imageurl);
+ image = msImageCreateGD(size_x, size_y, format, map->web.imagepath, map->web.imageurl, map->resolution);
/* drop this reference to output format */
msApplyOutputFormat(&format, NULL, MS_NOOVERRIDE, MS_NOOVERRIDE, MS_NOOVERRIDE);
Modified: trunk/mapserver/mappdf.c
===================================================================
--- trunk/mapserver/mappdf.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mappdf.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -226,7 +226,7 @@
oImage->img.pdf->imagetmp = (imageObj *)
msImageCreateGD(map->width, map->height,
msCreateDefaultOutputFormat(map, driver),
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
}
return oImage;
}
@@ -1460,7 +1460,7 @@
{
image_tmp = msImageCreateGD(map->width, map->height,
msCreateDefaultOutputFormat(map, driver),
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
}
else
{
Modified: trunk/mapserver/mapresample.c
===================================================================
--- trunk/mapserver/mapresample.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapresample.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -1563,7 +1563,7 @@
/* -------------------------------------------------------------------- */
srcImage = msImageCreate( nLoadImgXSize, nLoadImgYSize,
sDummyMap.outputformat, NULL, NULL,
- &sDummyMap );
+ &sDummyMap);
if (srcImage == NULL)
return -1; /* msSetError() should have been called already */
Modified: trunk/mapserver/mapscale.c
===================================================================
--- trunk/mapserver/mapscale.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapscale.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -258,7 +258,7 @@
/* create image */
image = msImageCreateGD(map->scalebar.width, sy, format,
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
/* drop this reference to output format */
msApplyOutputFormat( &format, NULL,
Modified: trunk/mapserver/mapserv.c
===================================================================
--- trunk/mapserver/mapserv.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapserv.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -1494,10 +1494,10 @@
/* initialize the legend image */
#ifdef USE_AGG
if(MS_RENDERER_AGG(mapserv->map->outputformat))
- img = msImageCreateAGG(mapserv->map->legend.keysizex, mapserv->map->legend.keysizey, format, mapserv->map->web.imagepath, mapserv->map->web.imageurl);
+ img = msImageCreateAGG(mapserv->map->legend.keysizex, mapserv->map->legend.keysizey, format, mapserv->map->web.imagepath, mapserv->map->web.imageurl, mapserv->map->resolution);
else
#endif
- img = msImageCreateGD(mapserv->map->legend.keysizex, mapserv->map->legend.keysizey, format, mapserv->map->web.imagepath, mapserv->map->web.imageurl);
+ img = msImageCreateGD(mapserv->map->legend.keysizex, mapserv->map->legend.keysizey, format, mapserv->map->web.imagepath, mapserv->map->web.imageurl, mapserv->map->resolution);
/* allocate the background color */
#ifdef USE_AGG
Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapserver.h 2009-03-09 19:09:55 UTC (rev 8721)
@@ -1369,6 +1369,7 @@
%immutable;
#endif
int width, height;
+ unsigned int resolution;
char *imagepath, *imageurl;
outputFormatObj *format;
@@ -1899,7 +1900,7 @@
/* ==================================================================== */
/* Prototypes for functions in mapimagemap.c */
/* ==================================================================== */
-MS_DLL_EXPORT imageObj *msImageCreateIM(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl);
+MS_DLL_EXPORT imageObj *msImageCreateIM(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, unsigned int resolution);
MS_DLL_EXPORT imageObj *msImageLoadIM( const char *filename );
MS_DLL_EXPORT imageObj *msImageLoadGD( const char *filename );
MS_DLL_EXPORT imageObj *msImageLoadGDCtx( gdIOCtx *ctx, const char *driver );
@@ -1926,7 +1927,7 @@
MS_DLL_EXPORT imageObj *msImageLoadGDCtx(gdIOCtx* ctx, const char *driver);
MS_DLL_EXPORT int msCompareColors(colorObj *c1, colorObj *c2);
MS_DLL_EXPORT void msPreAllocateColorsGD(imageObj *image, mapObj *map);
-MS_DLL_EXPORT imageObj *msImageCreateGD(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl);
+MS_DLL_EXPORT imageObj *msImageCreateGD(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, unsigned int resolution);
MS_DLL_EXPORT imageObj *msImageLoadGD( const char *filename );
MS_DLL_EXPORT void msImageInitGD( imageObj *image, colorObj *background );
MS_DLL_EXPORT int msImageSetPenGD(gdImagePtr img, colorObj *color);
@@ -1957,7 +1958,7 @@
/* Prototypes for functions in mapagg.cpp */
/* ==================================================================== */
-MS_DLL_EXPORT imageObj *msImageCreateAGG(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl);
+MS_DLL_EXPORT imageObj *msImageCreateAGG(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, unsigned int resolution);
MS_DLL_EXPORT void msImageInitAGG( imageObj *image, colorObj *background );
MS_DLL_EXPORT int msSaveImageAGG(imageObj *img, char *filename, outputFormatObj *format);
Modified: trunk/mapserver/mapswf.c
===================================================================
--- trunk/mapserver/mapswf.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapswf.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -1061,7 +1061,8 @@
image->height = height;
image->imagepath = NULL;
image->imageurl = NULL;
-
+ image->resolution = map->resolution;
+
if (imagepath)
{
image->imagepath = strdup(imagepath);
@@ -1145,7 +1146,7 @@
((SWFObj *)image->img.swf)->imagetmp = (imageObj *)
msImageCreateGD(map->width, map->height,
msCreateDefaultOutputFormat(map, driver),
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
}
free(driver);
return image;
@@ -2830,7 +2831,7 @@
{
image_tmp = msImageCreateGD(map->width, map->height,
msCreateDefaultOutputFormat(map, driver),
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
bFreeImage = 1;
}
else
@@ -3425,7 +3426,7 @@
{
imagetmp = msImageCreateGD(map->width, map->height,
msCreateDefaultOutputFormat(map, driver),
- map->web.imagepath, map->web.imageurl);
+ map->web.imagepath, map->web.imageurl, map->resolution);
bFreeImage = 1;
}
else
Modified: trunk/mapserver/maputil.c
===================================================================
--- trunk/mapserver/maputil.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/maputil.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -1324,14 +1324,14 @@
if( MS_RENDERER_GD(format) )
{
image = msImageCreateGD(width, height, format,
- imagepath, imageurl);
+ imagepath, imageurl, map->resolution);
if( image != NULL && map) msImageInitGD( image, &map->imagecolor );
}
#ifdef USE_AGG
else if( MS_RENDERER_AGG(format) )
{
image = msImageCreateAGG(width, height, format,
- imagepath, imageurl);
+ imagepath, imageurl, map->resolution);
if( image != NULL && map) msImageInitAGG( image, &map->imagecolor );
}
#endif
@@ -1375,7 +1375,8 @@
image->height = height;
image->imagepath = NULL;
image->imageurl = NULL;
-
+ image->resolution = map->resolution;
+
if (imagepath)
image->imagepath = strdup(imagepath);
if (imageurl)
@@ -1386,7 +1387,7 @@
else if( MS_RENDERER_IMAGEMAP(format) )
{
image = msImageCreateIM(width, height, format,
- imagepath, imageurl);
+ imagepath, imageurl, map->resolution);
if( image != NULL ) msImageInitIM( image );
}
#ifdef USE_MING_FLASH
Modified: trunk/mapserver/mapwcs.c
===================================================================
--- trunk/mapserver/mapwcs.c 2009-03-09 19:04:47 UTC (rev 8720)
+++ trunk/mapserver/mapwcs.c 2009-03-09 19:09:55 UTC (rev 8721)
@@ -1723,11 +1723,11 @@
msSetError(MS_WCSERR, "The map outputformat is missing!", "msWCSGetCoverage()");
return msWCSException(map, NULL, NULL, params->version );
} else if( MS_RENDERER_GD(map->outputformat) ) {
- image = msImageCreateGD(map->width, map->height, map->outputformat, map->web.imagepath, map->web.imageurl);
+ image = msImageCreateGD(map->width, map->height, map->outputformat, map->web.imagepath, map->web.imageurl, map->resolution);
if( image != NULL ) msImageInitGD( image, &map->imagecolor );
#ifdef USE_AGG
} else if( MS_RENDERER_AGG(map->outputformat) ) {
- image = msImageCreateAGG(map->width, map->height, map->outputformat, map->web.imagepath, map->web.imageurl);
+ image = msImageCreateAGG(map->width, map->height, map->outputformat, map->web.imagepath, map->web.imageurl, map->resolution);
if( image != NULL ) msImageInitAGG( image, &map->imagecolor );
#endif
} else if( MS_RENDERER_RAWDATA(map->outputformat) ) {
More information about the mapserver-commits
mailing list