diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2003-09-09 19:57:43 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2003-09-09 19:57:43 (GMT) |
commit | 5042f14501ee003ee5b13173877936f0138f0544 (patch) | |
tree | c0925e732c4e9f06ccfc3974882096c5f56db513 /src/pngenc.cpp | |
parent | d20edf5ddd0f90ea5b220ad743bf311f74383fc8 (diff) | |
download | Doxygen-5042f14501ee003ee5b13173877936f0138f0544.zip Doxygen-5042f14501ee003ee5b13173877936f0138f0544.tar.gz Doxygen-5042f14501ee003ee5b13173877936f0138f0544.tar.bz2 |
Release-1.3.3-20030909
Diffstat (limited to 'src/pngenc.cpp')
-rw-r--r-- | src/pngenc.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/pngenc.cpp b/src/pngenc.cpp index 3ed69b3..5a52e2f 100644 --- a/src/pngenc.cpp +++ b/src/pngenc.cpp @@ -27,6 +27,8 @@ #include <png.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> +#include <errno.h> #include "pngenc.h" #include "message.h" @@ -133,8 +135,15 @@ void PngEncoder::write(const char *name) png_set_rows(png_ptr,info_ptr,rows); file = fopen(name,"wb"); - png_init_io(png_ptr,file); - png_write_png(png_ptr,info_ptr,PNG_TRANSFORM_IDENTITY,NULL); + if (file==0) + { + err("Error opening png file %s for writing: %s!\n",name,strerror(errno)); + } + else + { + png_init_io(png_ptr,file); + png_write_png(png_ptr,info_ptr,PNG_TRANSFORM_IDENTITY,NULL); + } } png_destroy_write_struct(&png_ptr, &info_ptr); |