#2255 closed defect (fixed)
C#(MapServer 5.0 Beta3) - Exceptions caused by imageObj.write() and imageObj.getBytes()
Reported by: | Zhonghai | Owned by: | tamas |
---|---|---|---|
Priority: | high | Milestone: | 5.0 release |
Component: | MapScript-C# | Version: | 5.0 |
Severity: | normal | Keywords: | VS2005 |
Cc: |
Description
Hi there,
I've compiled MapServer 5.0 Beta3 myself with VS2005, things are working very well, including the AGG rendering. Unfortunatelly, when I save an image into a memory stream with functions imageObj.write() or imageObj.getBytes() , I get exception messages like:
System.OutOfMemoryException was caught Message="An Exception of type System.OutOfMemoryException was caught." Source="mapscript_csharp" StackTrace: by OSGeo.MapServer.imageObj.CreateByteArray(IntPtr data, Int32 size) by OSGeo.MapServer.mapscriptPINVOKE.imageObj_getBytes(HandleRef jarg1, SWIGByteArrayDelegate jarg2) by OSGeo.MapServer.imageObj.getBytes(SWIGByteArrayDelegate callback) by OSGeo.MapServer.imageObj.getBytes() by ClsMapping.drawMap(mapObj map) in ClsMapping.vb:line 434.
and the source code causes the problem above is:
Dim img As imageObj = Nothing img = map.draw() Dim memoryMap As MemoryStream = Nothing memoryMap = New MemoryStream(img.getBytes())
Seems that there is something wrong.
Change History (9)
follow-up: 2 comment:1 by , 17 years ago
comment:2 by , 17 years ago
Replying to tamas:
Does this problem exist only with AGG renderer or with GD as well?
Yes, I've tested it again, it occurs only with AGG renderer.
follow-up: 4 comment:3 by , 17 years ago
I've tested with GD and AGG and haven't experience such problem on WIN32 and WIN64. However I've built AGG as a static library not a dll.
Would you describe how did you compile agg and submit your test mapfile and data if any?
follow-up: 5 comment:4 by , 17 years ago
Replying to tamas:
I've tested with GD and AGG and haven't experience such problem on WIN32 and WIN64. However I've built AGG as a static library not a dll.
Would you describe how did you compile agg and submit your test mapfile and data if any?
Hi there,
this time I compiled MapServer with the beta4, it still has the same problem. I've made a test Windows application here for you. Please download the test application here:
http://www.megaupload.com/?d=9ZEYIYH6
the file contains:
- A Test Windows Application with the C# Wrapper that i compiled with VS2005;
- The compiled MapServer binary with MapServer-5.0.0-beta4;
- The AGG source code version I am using and how I compiled it -- agg-2.4;
- The nmake.opt and makefile.vc used for MapServer compilation.
If you need any further inforamtion, please let me know.
Best Regards
Zhonghai
comment:5 by , 17 years ago
It seems that the latest version (beta5) is working well. Would you make a test with that?
I've prepared the necessary binaries here:
http://vbkto.dyndns.org:1080/mapserver/szekerest-vc80-quick/package/bin.zip
Note: the assembly has a strong name signature so it should be re-registered in your application during the upgrade.
Tamas
comment:7 by , 17 years ago
comment:9 by , 17 years ago
Milestone: | → 5.0 release |
---|
Does this problem exist only with AGG renderer or with GD as well?