initial commit

This commit is contained in:
2024-06-11 14:31:52 +02:00
commit b585be3679
9 changed files with 561 additions and 0 deletions

20
imagemeta.cpp Normal file
View File

@ -0,0 +1,20 @@
#include "imagemeta.h"
ImageMeta::ImageMeta(const std::filesystem::path& path, const QString& text):
path{path}, text{text}
{
}
ImageMeta::ImageMeta(const QJsonObject& json, const std::filesystem::path& dir)
{
QJsonValue filename = json["file_name"];
if(filename == QJsonValue::Undefined || !filename.isString())
throw ParseException("No or invalid file_name field found");
path = dir/filename.toString().toStdString();
QJsonValue textfrommeta = json["text"];
text = textfrommeta.toString("");
}