if (!PyArg_Parse(args, "s", &name))
return NULL;
- inf = fopen(name, "r");
+ inf = fopen(name, "rw");
if (!inf) {
PyErr_SetString(ImgfileError, "can't open image file");
return NULL;
if (!PyArg_Parse(args, "s", &name))
return NULL;
- inf = fopen(name,"r");
+ inf = fopen(name,"rb");
if (!inf) {
PyErr_SetString(ImgfileError, "can't open image file");
return NULL;
return NULL;
goodwrite = 1;
- outf = fopen(name, "w");
+ outf = fopen(name, "wb");
if (!outf) {
PyErr_SetString(ImgfileError, "can't open output file");
return NULL;