git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41029 15284696-431f-4ddb-bdfa-cd5b030d7da7
@@ -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)
@@ -72,6 +72,7 @@ void cairo_write_bmp(void)
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);
@@ -9,7 +9,7 @@
#define FILE_NAME "map.png"
struct png_state
{
@@ -59,6 +59,7 @@ void write_bmp(void)
if (!output)
G_fatal_error("PNG: couldn't open output file %s", png.file_name);
@@ -107,11 +107,11 @@ class Application(wx.App):
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")
@@ -40,7 +40,7 @@ extern "C" {
#include "wximgview.h"
IMPLEMENT_APP_NO_MAIN(MyApp)
@@ -32,7 +32,7 @@
#include <grass/gis.h>
#include <grass/glocale.h>
Display *dpy;
int scrn;