MapServer / MapServer-import

3 stars 2 forks source link

Recent changes break mapscript dynamic symbols #923

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: sgillies@frii.com Date: 2004/10/01 - 16:34

In the mapserver unit tests in
mapserver/mapscript/python/tests/cases/symbolsettest.py we have
a test of creating a new pixmap symbol and using this symbol to
style a layer:

    def testDrawNewSymbol(self):
        """MapSymbolSetTestCase.testDrawNewSymbol: draw using a new symbol added
to the fixture"""
        symbol = mapscript.symbolObj('xmarks', XMARKS_IMAGE)
        symbol_index = self.map.symbolset.appendSymbol(symbol)
        assert symbol_index == 2, symbol_index
        num = self.map.symbolset.numsymbols
        assert num == 3, num
        inline_layer = self.map.getLayerByName('INLINE')
        s = inline_layer.getClass(0).getStyle(0)
        s.symbol = symbol_index
        s.size = 24
        msimg = self.map.draw()
        assert msimg.thisown == 1
        data = msimg.saveToString()
        filename = 'testDrawNewSymbol.png'
        fh = open(filename, 'wb')
        fh.write(data)
        fh.close()

Until recently this test produced the following image:
[see first attached image]

Now it produces:
[see second attached image]

The new symbol is not rendered.
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/10/01 - 16:51

Sean, do you have an idea of which changes broke this? The most recent changes
in that area were bug 751 (default symbol size), and bug 912 (the warning fixes
in mapgd.c). It would be nice if you could test with CVS snapshots to find out
at which point things stopped working.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2004/10/01 - 17:21

I'm too busy on other bugs to fix this one.  I'm pretty sure Julien can
find the problem quickly.  Or simply undo what we did.  Whatever it takes.

It affects all scaled pixmap symbols, not just dynamic ones, and maybe other
scaled symbols as well.  If no size is specified for a pixmap symbol style, the
pixmap is rendered.  If a size is specified, the symbol is not drawn.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2004/10/01 - 17:27

new pixmap symbol styled layer added to tests/test.map to demonstrate and
help debugging.  Requires CVS update.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2004/10/01 - 20:03

casting the scale as int broke it.  these look like hobu's changes and not
Julien's.  sorry, Julien.
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/10/01 - 20:26

I have reverted the changes from r1.65 of mapgd.c and committed to CVS.

Marking fixed. Sean, can you please verify?