summaryrefslogtreecommitdiff
path: root/examples/sample-photobooth.c
diff options
context:
space:
mode:
authorpeterbud <peterbudai@hotmail.com>2016-11-19 23:47:21 +0100
committerMarcus Meissner <marcus@jet.franken.de>2016-11-19 23:47:21 +0100
commit230e2554f8541df8c324ee889b75a6ce848aacf9 (patch)
treeb60e1dbc771449d5d04ebff08f08fc3068449fd2 /examples/sample-photobooth.c
parent835f2d7b2ab5a7879e1cb4e289777a4443094a32 (diff)
downloadlibgphoto2-230e2554f8541df8c324ee889b75a6ce848aacf9.tar.gz
add O_BINARY flag for open() calls to write images in binary mode on Windows
Diffstat (limited to 'examples/sample-photobooth.c')
-rw-r--r--examples/sample-photobooth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/sample-photobooth.c b/examples/sample-photobooth.c
index 65327152e..180e4e366 100644
--- a/examples/sample-photobooth.c
+++ b/examples/sample-photobooth.c
@@ -43,7 +43,7 @@ capture_to_file(Camera *camera, GPContext *context, char *fn) {
strcpy (s+1, t+1);
}
- fd = open(fn, O_CREAT | O_WRONLY, 0644);
+ fd = open (fn, O_CREAT | O_WRONLY | O_BINARY, 0644);
if (fd == -1)
return GP_ERROR;
@@ -205,7 +205,7 @@ main(int argc, char **argv) {
sprintf(output_file, "image-%04d.jpg", capturecnt++);
}
- fd = open(output_file, O_CREAT | O_WRONLY, 0644);
+ fd = open (output_file, O_CREAT | O_WRONLY | O_BINARY, 0644);
retval = gp_file_new_from_fd(&file, fd);
retval = gp_camera_file_get(camera, path->folder, path->name,
GP_FILE_TYPE_NORMAL, file, context);