diff options
| -rw-r--r-- | src/BMPImage.cpp | 2 | ||||
| -rw-r--r-- | src/files.cpp | 1 | ||||
| -rw-r--r-- | src/files.h | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/BMPImage.cpp b/src/BMPImage.cpp index a22e65d..3e3f675 100644 --- a/src/BMPImage.cpp +++ b/src/BMPImage.cpp @@ -117,6 +117,7 @@ namespace TehImage for(int y = height-1; y >= 0; y--) { + writer.flushBuffer(); for(int x = 0; x < width; x++) { Pixel& pixel = (*this)[x,y]; @@ -125,6 +126,7 @@ namespace TehImage writer.writeData(pixel.r); } writer.zeroBytes((4-((width * 3)%4))%4); + writer.flushBuffer(); } writer.close(); diff --git a/src/files.cpp b/src/files.cpp index 20f2672..c4c46a9 100644 --- a/src/files.cpp +++ b/src/files.cpp @@ -115,6 +115,7 @@ namespace TehImage :fileEndianness(fileEndianness) { file = fopen(filename.c_str(), "w"); + pos = 0; ready = true; } diff --git a/src/files.h b/src/files.h index ad65ce8..8d7d12f 100644 --- a/src/files.h +++ b/src/files.h @@ -4,7 +4,7 @@ #include <string> #define READER_BUFFER_SIZE 4096 -#define WRITER_BUFFER_SIZE 4096 +#define WRITER_BUFFER_SIZE 65536 #define DEFINE_INT_READER(TYPE) \ template<> TYPE Reader::readData<TYPE>() \ |
