[mapserver-dev] Is there a size limit on ImageMaps, and if so can I increase it?

Daniel Morissette dmorissette at mapgears.com
Mon Feb 25 13:28:44 EST 2008


Correction... use this patch instead:

--- mapimagemap.c       (revision 7396)
+++ mapimagemap.c       (working copy)
@@ -2029,7 +2029,7 @@
                {
                    snprintf(workbuffer, sizeof(workbuffer), "%s", 
img->img.imagemap+iIndice );
                    workbuffer[nSize-1] = '\0';
-                  msIO_fprintf(stream, workbuffer);
+                  msIO_fwrite(workbuffer, strlen(workbuffer), 1, stream);
                    iIndice +=nSize-1;
                }
                if (iIndice < size)
@@ -2039,7 +2039,7 @@
                }
            }
            else
-            msIO_fprintf(stream, img->img.imagemap);
+              msIO_fwrite(img->img.imagemap, size, 1, stream);
           if( strcasecmp("OFF",msGetOutputFormatOption( format, 
"SKIPENDTAG", "OFF" )) == 0){
                   if (dxf == 2)
                           msIO_fprintf(stream, "END");


Daniel Morissette wrote:
> Bob Bruce wrote:
>> Daniel:
>>               I am using version 4.10.2 . Previously I had this 
>> working in a version of MapServer in 2005 and it is still working to 
>> this day at www.themuralsofwinnipeg.com/Mpages/indexMuralsMap.php with 
>> this old version (if you select the South-Portage neighbourhood it 
>> works fine). Now I wanted to upgrade to version 4 but wasn't ready to 
>> take the leap to version 5. Do you think that I need to upgrade to 
>> version 5 and rebuild MapServer etc.?
>>
> 
> I don't know for sure, but chances are that the problem could have the 
> same root as the legend problem, that is: msIO_fprintf() returns 
> silently, without any error, if the output is too large. Based on a 
> quick look at mapimagemap.c that's probably not fixed in v5.0 for 
> imagemaps. It seems that the following patch (replacing msIO_fprintf() 
> with msIO_fwrite() as we did in ticket 1946 for legends) might solve the 
> problem for imagemaps:
> 
> 
> --- mapimagemap.c       (revision 7396)
> +++ mapimagemap.c       (working copy)
> @@ -2029,7 +2029,7 @@
>                {
>                    snprintf(workbuffer, sizeof(workbuffer), "%s", 
> img->img.imagemap+iIndice );
>                    workbuffer[nSize-1] = '\0';
> -                  msIO_fprintf(stream, workbuffer);
> +                  msIO_fwrite(workbuffer, nSize, 1, stream);
>                    iIndice +=nSize-1;
>                }
>                if (iIndice < size)
> 
> 
> If that works then please file a ticket in Trac and assign to me (Trac 
> id dmorissette) so that we include this fix in the next release.
> 
> Daniel


-- 
Daniel Morissette
http://www.mapgears.com/


More information about the mapserver-dev mailing list