mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-07-08 01:32:41 +08:00
ExifImage support to modify current buffered ExifData
This commit is contained in:
@@ -24,7 +24,7 @@ end:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const ExifDataRef* exif_image_get_exif_data(ExifImage* image) {
|
||||
ExifDataRef* exif_image_get_exif_data(ExifImage* image) {
|
||||
if (!image || !image->image) return nullptr;
|
||||
image->exif_data_ref.data = &image->image->exifData();
|
||||
return &image->exif_data_ref;
|
||||
@@ -224,19 +224,19 @@ ExifData* exif_data_new() {
|
||||
return new ExifData;
|
||||
}
|
||||
|
||||
int exif_data_add(ExifData* d, ExifKey* key, ExifValue* value) {
|
||||
if (!d || !key || !value || !key->key) return 0;
|
||||
d->data.add(*key->key, value->value.get());
|
||||
int exif_data_ref_add(ExifDataRef* d, ExifKey* key, ExifValue* value) {
|
||||
if (!d || !d->data || !key || !value || !key->key) return 0;
|
||||
d->data->add(*key->key, value->value.get());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int exif_data_clear(ExifData* d) {
|
||||
if (!d) return 0;
|
||||
d->data.clear();
|
||||
int exif_data_ref_clear(ExifDataRef* d) {
|
||||
if (!d || !d->data) return 0;
|
||||
d->data->clear();
|
||||
return 1;
|
||||
}
|
||||
|
||||
const ExifDataRef* exif_data_get_ref(ExifData* d) {
|
||||
ExifDataRef* exif_data_get_ref(ExifData* d) {
|
||||
if (!d) return nullptr;
|
||||
d->ref.data = &d->data;
|
||||
return &d->ref;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define _EXIF_EXIF_PRIV_H
|
||||
#include "exiv2/exiv2.hpp"
|
||||
typedef struct ExifDataRef {
|
||||
const Exiv2::ExifData* data = nullptr;
|
||||
Exiv2::ExifData* data = nullptr;
|
||||
} ExifDataRef;
|
||||
typedef struct ExifImage {
|
||||
Exiv2::Image::UniquePtr image;
|
||||
|
||||
Reference in New Issue
Block a user