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

@ -51,8 +51,14 @@ int main(int argc, char *argv[])
return 1;
}
ofs << ragePhoto.photo();
const bool ok = ofs.good();
ofs.close();
if (!ok) {
std::cout << "Failed to write file: " << argv[2] << std::endl;
return 1;
}
if (ragePhoto.format() == RagePhoto::GTA5)
std::cout << "GTA V Photo successfully exported" << std::endl;
else