diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-08 07:39:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-08 07:39:45 +0400 |
commit | 385cbb657dbf001dfb0aa47cf15f9c5cb291b325 (patch) | |
tree | da150aa25febcdd6f06768accb5ed376fb538eb5 /source/blender/imbuf/intern | |
parent | ba95dc859d214aaa56256b0bf2a3ffd3a25689e5 (diff) |
patch [#36633] Correct headers for renders saved as bitmap (.bmp) format.
by Brandon Northcutt (occamsdream)
Blender was writing invalid bitmaps that imagemagick and ffmpeg couldn't read.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/bmp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index eb3cfc3ade3..dabeec74a62 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -273,7 +273,7 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) if (!ofile) return 0; putShortLSB(19778, ofile); /* "BM" */ - putIntLSB(0, ofile); /* This can be 0 for BI_RGB bitmaps */ + putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader), ofile); /* Total file size */ putShortLSB(0, ofile); /* Res1 */ putShortLSB(0, ofile); /* Res2 */ putIntLSB(BMP_FILEHEADER_SIZE + sizeof(infoheader), ofile); @@ -284,7 +284,7 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) putShortLSB(1, ofile); putShortLSB(24, ofile); putIntLSB(0, ofile); - putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader), ofile); + putIntLSB(bytesize, ofile); putIntLSB((int)(ibuf->ppm[0] + 0.5), ofile); putIntLSB((int)(ibuf->ppm[1] + 0.5), ofile); putIntLSB(0, ofile); |