libragephoto: add RagePhotoB for best implementation

CMakeLists.txt: add RagePhotoB class, improve settings clarification
doc/build.doc: add RAGEPHOTO_C_LIBRARY flag
doc/index.doc: correct RagePhoto.h header
doc/usage.doc: fix minor documentation issue, clarify class differences
ragephoto-gtkviewer: use RagePhotoB class
ragephoto-qtviewer: use RagePhotoB class
RagePhoto-Extract.cpp: use RagePhotoB class
RagePhoto.cpp: LIBRAGEPHOTO_C_API -> LIBRAGEPHOTO_CXX_C
RagePhotoA.hpp: simplify brief
RagePhotoB.hpp: add best implementation detection
RagePhotoLibrary.h: fix WASM C API inclusion by default
README.md: add RAGEPHOTO_C_LIBRARY flag
This commit is contained in:
Syping 2023-06-11 05:41:32 +02:00
parent d7943e552d
commit 12507be85d
13 changed files with 81 additions and 38 deletions

View file

@ -16,7 +16,7 @@
* responsible for anything with use of the software, you are self responsible.
*****************************************************************************/
#include <RagePhoto>
#include <RagePhotoB>
#include <QApplication>
#include <QHBoxLayout>
#include <QVBoxLayout>
@ -35,11 +35,11 @@ bool readPhotoFile(const QString &filename, QMainWindow *mainWindow, QLabel *pho
if (file.open(QIODevice::ReadOnly)) {
const QByteArray fileData = file.readAll();
file.close();
RagePhoto ragePhoto;
RagePhotoB ragePhoto;
const bool loaded = ragePhoto.load(fileData.data(), static_cast<size_t>(fileData.size()));
if (!loaded) {
const int32_t error = ragePhoto.error();
if (error <= RagePhoto::PhotoReadError) {
if (error <= RagePhotoB::PhotoReadError) {
QMessageBox::warning(mainWindow, "Open Photo", "Failed to read photo: " + filename);
return false;
}