mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Fix rational list not converted from/to json correctly
This commit is contained in:
parent
8d2024c334
commit
4a8784f508
1 changed files with 16 additions and 6 deletions
|
@ -17,8 +17,14 @@ class Exif {
|
||||||
jsonValue = base64UrlEncode(value);
|
jsonValue = base64UrlEncode(value);
|
||||||
} else if (value is Rational) {
|
} else if (value is Rational) {
|
||||||
jsonValue = value.toJson();
|
jsonValue = value.toJson();
|
||||||
} else if (value is List<Rational>) {
|
} else if (value is List) {
|
||||||
jsonValue = value.map((e) => e.toJson()).toList();
|
jsonValue = value.map((e) {
|
||||||
|
if (e is Rational) {
|
||||||
|
return e.toJson();
|
||||||
|
} else {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}).toList();
|
||||||
} else {
|
} else {
|
||||||
jsonValue = value;
|
jsonValue = value;
|
||||||
}
|
}
|
||||||
|
@ -33,10 +39,14 @@ class Exif {
|
||||||
exifValue = base64Decode(value);
|
exifValue = base64Decode(value);
|
||||||
} else if (value is Map) {
|
} else if (value is Map) {
|
||||||
exifValue = Rational.fromJson(value.cast<String, dynamic>());
|
exifValue = Rational.fromJson(value.cast<String, dynamic>());
|
||||||
} else if (value is List<Map>) {
|
} else if (value is List) {
|
||||||
exifValue = value
|
exifValue = value.map((e) {
|
||||||
.map((e) => Rational.fromJson(e.cast<String, dynamic>()))
|
if (e is Map) {
|
||||||
.toList();
|
return Rational.fromJson(e.cast<String, dynamic>());
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}).toList();
|
||||||
} else {
|
} else {
|
||||||
exifValue = value;
|
exifValue = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue