MapServer icon indicating copy to clipboard operation
MapServer copied to clipboard

A symbolized line is not rendered properly if GEOS disabled and style with OFFSET -99 used.

Open andrei-varnavskiy opened this issue 3 years ago • 1 comments

Expected behavior and actual behavior.

Multiple times renering of mapfile with style (STYLE SYMBOL cloud WIDTH 4 SIZE 10 COLOR 216 0 0 ANGLE AUTO OFFSET 5 -99 END) produces invalid image.

Expected png: test_good

Actual png: test_bug

Steps to reproduce the problem.

Here is the files to reproduce the problem: test.zip

The Dockerfile in test.zip is a slightly modified Dockerfile from this repository. I have enabled -DWITH_PYTHON=ON and -DWITH_RSVG=ON, and disabled -DWITH_GEOS=OFF

  1. extract test.zip
  2. build docker image: docker build --build-arg GDAL_VERSION=release/2.4 --build-arg MAPSERVER_VERSION=branch-7-6 -t mapserver mapserver
  3. start the container in separate console: docker -it mapserver
  4. get the running container id: docker ps
  5. docker cp ./test.py (container-id):/home/msuser/test.py
  6. docker cp ./test.map (container-id):/home/msuser/test.map
  7. docker cp ./cloud.svg (container-id):/home/msuser/cloud.svg
  8. at the console running the container: cd /home/msuser && python test.py
  9. the /home/msuser folder will contain invalid test.png file

I looks like the msOffsetCurve function in maputil.c is broken and gcc compiler makes address assignment instead of copy assignment at lines old_pt=p->line[i].point[0]; and const pointObj pt = p->line[i].point[j];

Operating system

Ubuntu 16.04 64 bit Ubuntu 20.04 64 bit

MapServer version and installation method

mapserver branch-7-6, the branch 'main' is affected too Dockerfile from this git

andrei-varnavskiy avatar May 19 '22 10:05 andrei-varnavskiy

@andrei-varnavskiy I have not verified this, but pull requests are warmly welcomed here :)

jmckenna avatar May 19 '22 13:05 jmckenna