[GRASS-SVN] r50520 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 28 06:21:43 EST 2012


Author: annakrat
Date: 2012-01-28 03:21:43 -0800 (Sat, 28 Jan 2012)
New Revision: 50520

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py
Log:
wxGUI/wxpsmap: attempt to fix preview #1554

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py	2012-01-28 10:49:20 UTC (rev 50519)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py	2012-01-28 11:21:43 UTC (rev 50520)
@@ -143,7 +143,7 @@
         
         # image path
         env = grass.gisenv()
-        self.imgName = os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'], '.tmp', 'tmpImage.png')
+        self.imgName = grass.tempfile()
         
         #canvas for preview
         self.previewCanvas = PsMapBufferedWindow(parent = self, mouse = self.mouse, cursors = self.cursors,
@@ -313,14 +313,14 @@
                 im = Image.open(event.userData['filename'])
                 if self.instruction[self.pageId]['Orientation'] == 'Landscape':
                     im = im.rotate(270)
+                print self.imgName
+                im.save(self.imgName, format = 'PNG')
                 
-                im.save(self.imgName, format = 'png')
-                
             except IOError, e:
                 GError(parent = self,
                        message = _("Unable to generate preview. %s") % e)
+                return
             
-            
                 
             rect = self.previewCanvas.ImageRect()
             self.previewCanvas.image = wx.Image(self.imgName, wx.BITMAP_TYPE_PNG)



More information about the grass-commit mailing list