Exemplo n.º 1
0
 def testConstructorFilename(self):
     """imageObj with a filename works"""
     imgobj = mapscript.imageObj(test_image)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
     imgobj.save('testConstructorFilename.png')
Exemplo n.º 2
0
 def setUp(self):
     MapTestCase.setUp(self)
     f = open(HOME_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.h_symbol = mapscript.symbolObj('house')
     self.h_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.h_symbol.setImage(symb_img)
     f = open(XMARKS_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.x_symbol = mapscript.symbolObj('xmarks')
     self.x_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.x_symbol.setImage(symb_img)
Exemplo n.º 3
0
 def testConstructorFilename(self):
     """imageObj with a filename works"""
     imgobj = mapscript.imageObj(test_image)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
     imgobj.save('testConstructorFilename.png')
Exemplo n.º 4
0
 def setUp(self):
     MapTestCase.setUp(self)
     f = open(HOME_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.h_symbol = mapscript.symbolObj('house')
     self.h_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.h_symbol.setImage(symb_img)
     f = open(XMARKS_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.x_symbol = mapscript.symbolObj('xmarks')
     self.x_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.x_symbol.setImage(symb_img)
Exemplo n.º 5
0
 def testConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.gis.umn.edu/logo.jpg')
     imgobj = mapscript.imageObj(url, 'GD/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Exemplo n.º 6
0
 def testConstructorStream(self):
     """imageObj with a file stream works"""
     f = open(test_image, 'rb')
     imgobj = mapscript.imageObj(f)
     f.close()
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Exemplo n.º 7
0
 def testConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.gis.umn.edu/logo.jpg')
     imgobj = mapscript.imageObj(url, 'GD/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Exemplo n.º 8
0
 def testConstructorStream(self):
     """imageObj with a file stream works"""
     f = open(test_image, 'rb')
     imgobj = mapscript.imageObj(f)
     f.close()
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Exemplo n.º 9
0
 def xtestConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.org/_static/banner.png')
     imgobj = mapscript.imageObj(url, 'AGG/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Exemplo n.º 10
0
 def xtestConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.org/_static/banner.png')
     imgobj = mapscript.imageObj(url, 'AGG/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Exemplo n.º 11
0
 def testConstructorWithFormat(self):
     """imageObj with an optional driver works"""
     driver = 'GD/PNG'
     format = mapscript.outputFormatObj(driver)
     imgobj = mapscript.imageObj(10, 10, format)
     assert imgobj.thisown == 1
     assert imgobj.format.driver == driver
     assert imgobj.height == 10
     assert imgobj.width == 10
Exemplo n.º 12
0
 def testConstructorWithFormat(self):
     """imageObj with an optional driver works"""
     driver = 'GD/PNG'
     format = mapscript.outputFormatObj(driver)
     imgobj = mapscript.imageObj(10, 10, format)
     assert imgobj.thisown == 1
     assert imgobj.format.driver == driver
     assert imgobj.height == 10
     assert imgobj.width == 10
Exemplo n.º 13
0
 def testConstructorStringIO(self):
     """imageObj with a cStringIO works"""
     f = open(test_image, 'rb')
     data = f.read()
     f.close()
     s = cStringIO.StringIO(data)
     imgobj = mapscript.imageObj(s)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Exemplo n.º 14
0
 def testConstructorStringIO(self):
     """imageObj with a cStringIO works"""
     f = open(test_image, 'rb')
     data = f.read()
     f.close()
     s = cStringIO.StringIO(data)
     imgobj = mapscript.imageObj(s)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Exemplo n.º 15
0
 def testConstructor(self):
     """imageObj constructor works"""
     imgobj = mapscript.imageObj(10, 10)
     assert imgobj.thisown == 1
     assert imgobj.height == 10
     assert imgobj.width == 10
Exemplo n.º 16
0
 def testConstructor(self):
     """imageObj constructor works"""
     imgobj = mapscript.imageObj(10, 10)
     assert imgobj.thisown == 1
     assert imgobj.height == 10
     assert imgobj.width == 10