[GRASS-SVN] r41029 - in grass/trunk: lib/cairodriver lib/pngdriver
scripts/wxpyimgview visualization/wximgview visualization/ximgview
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 15 07:20:56 EST 2010
Author: glynn
Date: 2010-02-15 07:20:55 -0500 (Mon, 15 Feb 2010)
New Revision: 41029
Modified:
grass/trunk/lib/cairodriver/cairodriver.h
grass/trunk/lib/cairodriver/write_bmp.c
grass/trunk/lib/pngdriver/pngdriver.h
grass/trunk/lib/pngdriver/write_bmp.c
grass/trunk/scripts/wxpyimgview/wxpyimgview_gui.py
grass/trunk/visualization/wximgview/main.cc
grass/trunk/visualization/ximgview/main.c
Log:
Use 64-byte header to ensure frame buffer alignment
Modified: grass/trunk/lib/cairodriver/cairodriver.h
===================================================================
--- grass/trunk/lib/cairodriver/cairodriver.h 2010-02-15 11:58:59 UTC (rev 41028)
+++ grass/trunk/lib/cairodriver/cairodriver.h 2010-02-15 12:20:55 UTC (rev 41029)
@@ -42,7 +42,7 @@
#define DEFAULT_FILE_NAME "map.png"
-#define HEADER_SIZE 54
+#define HEADER_SIZE 64
/* Scale for converting colors from [0..255] to cairo's [0.0..1.0] */
#define COLORSCALE (1.0/255.0)
Modified: grass/trunk/lib/cairodriver/write_bmp.c
===================================================================
--- grass/trunk/lib/cairodriver/write_bmp.c 2010-02-15 11:58:59 UTC (rev 41028)
+++ grass/trunk/lib/cairodriver/write_bmp.c 2010-02-15 12:20:55 UTC (rev 41029)
@@ -72,6 +72,7 @@
G_fatal_error(_("Cairo: unable to open output file <%s>"),
ca.file_name);
+ memset(header, 0, sizeof(header));
make_bmp_header(header);
fwrite(header, sizeof(header), 1, output);
Modified: grass/trunk/lib/pngdriver/pngdriver.h
===================================================================
--- grass/trunk/lib/pngdriver/pngdriver.h 2010-02-15 11:58:59 UTC (rev 41028)
+++ grass/trunk/lib/pngdriver/pngdriver.h 2010-02-15 12:20:55 UTC (rev 41029)
@@ -9,7 +9,7 @@
#define FILE_NAME "map.png"
-#define HEADER_SIZE 54
+#define HEADER_SIZE 64
struct png_state
{
Modified: grass/trunk/lib/pngdriver/write_bmp.c
===================================================================
--- grass/trunk/lib/pngdriver/write_bmp.c 2010-02-15 11:58:59 UTC (rev 41028)
+++ grass/trunk/lib/pngdriver/write_bmp.c 2010-02-15 12:20:55 UTC (rev 41029)
@@ -59,6 +59,7 @@
if (!output)
G_fatal_error("PNG: couldn't open output file %s", png.file_name);
+ memset(header, 0, sizeof(header));
make_bmp_header(header);
fwrite(header, sizeof(header), 1, output);
Modified: grass/trunk/scripts/wxpyimgview/wxpyimgview_gui.py
===================================================================
--- grass/trunk/scripts/wxpyimgview/wxpyimgview_gui.py 2010-02-15 11:58:59 UTC (rev 41028)
+++ grass/trunk/scripts/wxpyimgview/wxpyimgview_gui.py 2010-02-15 12:20:55 UTC (rev 41029)
@@ -107,11 +107,11 @@
def __init__(self):
self.image = sys.argv[1]
self.fraction = int(sys.argv[2]) / 100.0
- self.HEADER_SIZE = 54
+ self.HEADER_SIZE = 64
wx.App.__init__(self)
def read_bmp_header(self, header):
- magic, bmfh, bmih = struct.unpack("2s12s40s", header)
+ magic, bmfh, bmih = struct.unpack("2s12s40s10x", header)
if magic != 'BM':
raise SyntaxError("Invalid magic number")
Modified: grass/trunk/visualization/wximgview/main.cc
===================================================================
--- grass/trunk/visualization/wximgview/main.cc 2010-02-15 11:58:59 UTC (rev 41028)
+++ grass/trunk/visualization/wximgview/main.cc 2010-02-15 12:20:55 UTC (rev 41029)
@@ -40,7 +40,7 @@
#include "wximgview.h"
-#define HEADER_SIZE 54
+#define HEADER_SIZE 64
IMPLEMENT_APP_NO_MAIN(MyApp)
Modified: grass/trunk/visualization/ximgview/main.c
===================================================================
--- grass/trunk/visualization/ximgview/main.c 2010-02-15 11:58:59 UTC (rev 41028)
+++ grass/trunk/visualization/ximgview/main.c 2010-02-15 12:20:55 UTC (rev 41029)
@@ -32,7 +32,7 @@
#include <grass/gis.h>
#include <grass/glocale.h>
-#define HEADER_SIZE 54
+#define HEADER_SIZE 64
Display *dpy;
int scrn;
More information about the grass-commit
mailing list