Improve ragephoto-extract, RagePhoto header change

RagePhoto-Extract.c: use fopen_s on Windows
RagePhoto-Extract.cpp: use good() to check if file successfully written
RagePhoto.h: remove LIBRAGEPHOTO_C_API #ifdef to force error if compiled
without C API
This commit is contained in:
Syping 2021-11-13 09:47:03 +01:00
parent 136a6e1fec
commit 44d67fa78f
3 changed files with 12 additions and 2 deletions

View file

@ -27,6 +27,7 @@ int main(int argc, char *argv[])
return 0;
}
// Initialise RagePhoto
ragephoto_t ragephoto_in = ragephoto_open();
// Load Photo
@ -44,7 +45,12 @@ int main(int argc, char *argv[])
}
// Write jpeg
#ifdef _WIN32
FILE *file = NULL;
fopen_s(&file, argv[2], "wb");
#else
FILE *file = fopen(argv[2], "wb");
#endif
if (!file) {
printf("Failed to write file: %s\n", argv[2]);
return 1;