コード例 #1
0
ファイル: imagetest.py プロジェクト: outrun123/mapserver
 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')
コード例 #2
0
ファイル: symboltest.py プロジェクト: AdRiley/mapserver
 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)
コード例 #3
0
ファイル: imagetest.py プロジェクト: codeforeurope/gim
 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')
コード例 #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)
コード例 #5
0
ファイル: imagetest.py プロジェクト: outrun123/mapserver
 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')
コード例 #6
0
ファイル: imagetest.py プロジェクト: outrun123/mapserver
 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
コード例 #7
0
ファイル: imagetest.py プロジェクト: codeforeurope/gim
 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')
コード例 #8
0
ファイル: imagetest.py プロジェクト: codeforeurope/gim
 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
コード例 #9
0
ファイル: imagetest.py プロジェクト: BentleySystems/mapserver
 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')
コード例 #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')
コード例 #11
0
ファイル: imagetest.py プロジェクト: outrun123/mapserver
 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
コード例 #12
0
ファイル: imagetest.py プロジェクト: codeforeurope/gim
 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
コード例 #13
0
ファイル: imagetest.py プロジェクト: outrun123/mapserver
 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
コード例 #14
0
ファイル: imagetest.py プロジェクト: codeforeurope/gim
 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
コード例 #15
0
ファイル: imagetest.py プロジェクト: outrun123/mapserver
 def testConstructor(self):
     """imageObj constructor works"""
     imgobj = mapscript.imageObj(10, 10)
     assert imgobj.thisown == 1
     assert imgobj.height == 10
     assert imgobj.width == 10
コード例 #16
0
ファイル: imagetest.py プロジェクト: codeforeurope/gim
 def testConstructor(self):
     """imageObj constructor works"""
     imgobj = mapscript.imageObj(10, 10)
     assert imgobj.thisown == 1
     assert imgobj.height == 10
     assert imgobj.width == 10