info: improved some xmp display
This commit is contained in:
parent
8df538e7f7
commit
4abc9c9844
12 changed files with 62 additions and 43 deletions
|
@ -13,25 +13,35 @@ class XMP {
|
||||||
'crs': 'Camera Raw Settings',
|
'crs': 'Camera Raw Settings',
|
||||||
'dc': 'Dublin Core',
|
'dc': 'Dublin Core',
|
||||||
'drone-dji': 'DJI Drone',
|
'drone-dji': 'DJI Drone',
|
||||||
|
'exif': 'Exif',
|
||||||
'exifEX': 'Exif Ex',
|
'exifEX': 'Exif Ex',
|
||||||
'GettyImagesGIFT': 'Getty Images',
|
'GettyImagesGIFT': 'Getty Images',
|
||||||
|
'GAudio': 'Google Audio',
|
||||||
|
'GDepth': 'Google Depth',
|
||||||
|
'GImage': 'Google Image',
|
||||||
'GIMP': 'GIMP',
|
'GIMP': 'GIMP',
|
||||||
'GCamera': 'Google Camera',
|
'GCamera': 'Google Camera',
|
||||||
'GCreations': 'Google Creations',
|
'GCreations': 'Google Creations',
|
||||||
'GFocus': 'Google Focus',
|
'GFocus': 'Google Focus',
|
||||||
'GPano': 'Google Panorama',
|
'GPano': 'Google Panorama',
|
||||||
'illustrator': 'Illustrator',
|
'illustrator': 'Illustrator',
|
||||||
|
'Iptc4xmpCore': 'IPTC Core',
|
||||||
'lr': 'Lightroom',
|
'lr': 'Lightroom',
|
||||||
'MicrosoftPhoto': 'Microsoft Photo',
|
'MicrosoftPhoto': 'Microsoft Photo',
|
||||||
|
'mwg-rs': 'Regions',
|
||||||
'panorama': 'Panorama',
|
'panorama': 'Panorama',
|
||||||
|
'PanoStudioXMP': 'PanoramaStudio',
|
||||||
'pdf': 'PDF',
|
'pdf': 'PDF',
|
||||||
'pdfx': 'PDF/X',
|
'pdfx': 'PDF/X',
|
||||||
'PanoStudioXMP': 'PanoramaStudio',
|
|
||||||
'photomechanic': 'Photo Mechanic',
|
'photomechanic': 'Photo Mechanic',
|
||||||
|
'photoshop': 'Photoshop',
|
||||||
'plus': 'PLUS',
|
'plus': 'PLUS',
|
||||||
'pmtm': 'Photomatix',
|
'pmtm': 'Photomatix',
|
||||||
|
'tiff': 'TIFF',
|
||||||
|
'xmp': 'Basic',
|
||||||
'xmpBJ': 'Basic Job Ticket',
|
'xmpBJ': 'Basic Job Ticket',
|
||||||
'xmpDM': 'Dynamic Media',
|
'xmpDM': 'Dynamic Media',
|
||||||
|
'xmpMM': 'Media Management',
|
||||||
'xmpRights': 'Rights Management',
|
'xmpRights': 'Rights Management',
|
||||||
'xmpTPg': 'Paged-Text',
|
'xmpTPg': 'Paged-Text',
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/utils/string_utils.dart';
|
import 'package:aves/utils/string_utils.dart';
|
||||||
import 'package:aves/widgets/common/identity/highlight_title.dart';
|
import 'package:aves/widgets/common/identity/highlight_title.dart';
|
||||||
import 'package:aves/widgets/viewer/info/common.dart';
|
import 'package:aves/widgets/viewer/info/common.dart';
|
||||||
|
import 'package:aves/widgets/viewer/info/metadata/xmp_ns/crs.dart';
|
||||||
import 'package:aves/widgets/viewer/info/metadata/xmp_ns/darktable.dart';
|
import 'package:aves/widgets/viewer/info/metadata/xmp_ns/darktable.dart';
|
||||||
import 'package:aves/widgets/viewer/info/metadata/xmp_ns/exif.dart';
|
import 'package:aves/widgets/viewer/info/metadata/xmp_ns/exif.dart';
|
||||||
import 'package:aves/widgets/viewer/info/metadata/xmp_ns/google.dart';
|
import 'package:aves/widgets/viewer/info/metadata/xmp_ns/google.dart';
|
||||||
|
@ -31,6 +32,8 @@ class XmpNamespace extends Equatable {
|
||||||
switch (namespace) {
|
switch (namespace) {
|
||||||
case XmpBasicNamespace.ns:
|
case XmpBasicNamespace.ns:
|
||||||
return XmpBasicNamespace(rawProps);
|
return XmpBasicNamespace(rawProps);
|
||||||
|
case XmpCrsNamespace.ns:
|
||||||
|
return XmpCrsNamespace(rawProps);
|
||||||
case XmpDarktableNamespace.ns:
|
case XmpDarktableNamespace.ns:
|
||||||
return XmpDarktableNamespace(rawProps);
|
return XmpDarktableNamespace(rawProps);
|
||||||
case XmpExifNamespace.ns:
|
case XmpExifNamespace.ns:
|
||||||
|
|
36
lib/widgets/viewer/info/metadata/xmp_ns/crs.dart
Normal file
36
lib/widgets/viewer/info/metadata/xmp_ns/crs.dart
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import 'package:aves/widgets/viewer/info/metadata/xmp_namespaces.dart';
|
||||||
|
import 'package:aves/widgets/viewer/info/metadata/xmp_structs.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
class XmpCrsNamespace extends XmpNamespace {
|
||||||
|
static const ns = 'crs';
|
||||||
|
|
||||||
|
static final cgbcPattern = RegExp(ns + r':CircularGradientBasedCorrections\[(\d+)\]/(.*)');
|
||||||
|
static final lookPattern = RegExp(ns + r':Look/(.*)');
|
||||||
|
|
||||||
|
final cgbc = <int, Map<String, String>>{};
|
||||||
|
final look = <String, String>{};
|
||||||
|
|
||||||
|
XmpCrsNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool extractData(XmpProp prop) {
|
||||||
|
final hasStructs = extractStruct(prop, lookPattern, look);
|
||||||
|
final hasIndexedStructs = extractIndexedStruct(prop, cgbcPattern, cgbc);
|
||||||
|
return hasStructs || hasIndexedStructs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Widget> buildFromExtractedData() => [
|
||||||
|
if (look.isNotEmpty)
|
||||||
|
XmpStructCard(
|
||||||
|
title: 'Look',
|
||||||
|
struct: look,
|
||||||
|
),
|
||||||
|
if (cgbc.isNotEmpty)
|
||||||
|
XmpStructArrayCard(
|
||||||
|
title: 'Circular Gradient Based Corrections',
|
||||||
|
structByIndex: cgbc,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
|
@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
||||||
class XmpDarktableNamespace extends XmpNamespace {
|
class XmpDarktableNamespace extends XmpNamespace {
|
||||||
static const ns = 'darktable';
|
static const ns = 'darktable';
|
||||||
|
|
||||||
static final historyPattern = RegExp(r'darktable:history\[(\d+)\]/(.*)');
|
static final historyPattern = RegExp(ns + r':history\[(\d+)\]/(.*)');
|
||||||
|
|
||||||
final history = <int, Map<String, String>>{};
|
final history = <int, Map<String, String>>{};
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,6 @@ class XmpExifNamespace extends XmpNamespace {
|
||||||
|
|
||||||
const XmpExifNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
const XmpExifNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Exif';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String formatValue(XmpProp prop) {
|
String formatValue(XmpProp prop) {
|
||||||
final v = prop.value;
|
final v = prop.value;
|
||||||
|
|
|
@ -39,9 +39,6 @@ class XmpGAudioNamespace extends XmpGoogleNamespace {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Tuple2<String, String>> get dataProps => const [Tuple2('$ns:Data', '$ns:Mime')];
|
List<Tuple2<String, String>> get dataProps => const [Tuple2('$ns:Data', '$ns:Mime')];
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Google Audio';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class XmpGDepthNamespace extends XmpGoogleNamespace {
|
class XmpGDepthNamespace extends XmpGoogleNamespace {
|
||||||
|
@ -54,9 +51,6 @@ class XmpGDepthNamespace extends XmpGoogleNamespace {
|
||||||
Tuple2('$ns:Data', '$ns:Mime'),
|
Tuple2('$ns:Data', '$ns:Mime'),
|
||||||
Tuple2('$ns:Confidence', '$ns:ConfidenceMime'),
|
Tuple2('$ns:Confidence', '$ns:ConfidenceMime'),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Google Depth';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class XmpGImageNamespace extends XmpGoogleNamespace {
|
class XmpGImageNamespace extends XmpGoogleNamespace {
|
||||||
|
@ -66,7 +60,4 @@ class XmpGImageNamespace extends XmpGoogleNamespace {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Tuple2<String, String>> get dataProps => const [Tuple2('$ns:Data', '$ns:Mime')];
|
List<Tuple2<String, String>> get dataProps => const [Tuple2('$ns:Data', '$ns:Mime')];
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Google Image';
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,12 @@ import 'package:flutter/material.dart';
|
||||||
class XmpIptcCoreNamespace extends XmpNamespace {
|
class XmpIptcCoreNamespace extends XmpNamespace {
|
||||||
static const ns = 'Iptc4xmpCore';
|
static const ns = 'Iptc4xmpCore';
|
||||||
|
|
||||||
static final creatorContactInfoPattern = RegExp(r'Iptc4xmpCore:CreatorContactInfo/(.*)');
|
static final creatorContactInfoPattern = RegExp(ns + r':CreatorContactInfo/(.*)');
|
||||||
|
|
||||||
final creatorContactInfo = <String, String>{};
|
final creatorContactInfo = <String, String>{};
|
||||||
|
|
||||||
XmpIptcCoreNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
XmpIptcCoreNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'IPTC Core';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool extractData(XmpProp prop) => extractStruct(prop, creatorContactInfoPattern, creatorContactInfo);
|
bool extractData(XmpProp prop) => extractStruct(prop, creatorContactInfoPattern, creatorContactInfo);
|
||||||
|
|
||||||
|
|
|
@ -6,17 +6,14 @@ import 'package:flutter/widgets.dart';
|
||||||
class XmpMgwRegionsNamespace extends XmpNamespace {
|
class XmpMgwRegionsNamespace extends XmpNamespace {
|
||||||
static const ns = 'mwg-rs';
|
static const ns = 'mwg-rs';
|
||||||
|
|
||||||
static final dimensionsPattern = RegExp(r'mwg-rs:Regions/mwg-rs:AppliedToDimensions/(.*)');
|
static final dimensionsPattern = RegExp(ns + r':Regions/mwg-rs:AppliedToDimensions/(.*)');
|
||||||
static final regionListPattern = RegExp(r'mwg-rs:Regions/mwg-rs:RegionList\[(\d+)\]/(.*)');
|
static final regionListPattern = RegExp(ns + r':Regions/mwg-rs:RegionList\[(\d+)\]/(.*)');
|
||||||
|
|
||||||
final dimensions = <String, String>{};
|
final dimensions = <String, String>{};
|
||||||
final regionList = <int, Map<String, String>>{};
|
final regionList = <int, Map<String, String>>{};
|
||||||
|
|
||||||
XmpMgwRegionsNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
XmpMgwRegionsNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Regions';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool extractData(XmpProp prop) {
|
bool extractData(XmpProp prop) {
|
||||||
final hasStructs = extractStruct(prop, dimensionsPattern, dimensions);
|
final hasStructs = extractStruct(prop, dimensionsPattern, dimensions);
|
||||||
|
|
|
@ -7,9 +7,6 @@ class XmpPhotoshopNamespace extends XmpNamespace {
|
||||||
|
|
||||||
const XmpPhotoshopNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
const XmpPhotoshopNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Photoshop';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String formatValue(XmpProp prop) {
|
String formatValue(XmpProp prop) {
|
||||||
final value = prop.value;
|
final value = prop.value;
|
||||||
|
|
|
@ -5,9 +5,6 @@ import 'package:aves/widgets/viewer/info/metadata/xmp_namespaces.dart';
|
||||||
class XmpTiffNamespace extends XmpNamespace {
|
class XmpTiffNamespace extends XmpNamespace {
|
||||||
static const ns = 'tiff';
|
static const ns = 'tiff';
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'TIFF';
|
|
||||||
|
|
||||||
const XmpTiffNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
const XmpTiffNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -9,16 +9,13 @@ import 'package:flutter/material.dart';
|
||||||
class XmpBasicNamespace extends XmpNamespace {
|
class XmpBasicNamespace extends XmpNamespace {
|
||||||
static const ns = 'xmp';
|
static const ns = 'xmp';
|
||||||
|
|
||||||
static final thumbnailsPattern = RegExp(r'xmp:Thumbnails\[(\d+)\]/(.*)');
|
static final thumbnailsPattern = RegExp(ns + r':Thumbnails\[(\d+)\]/(.*)');
|
||||||
static const thumbnailDataDisplayKey = 'Image';
|
static const thumbnailDataDisplayKey = 'Image';
|
||||||
|
|
||||||
final thumbnails = <int, Map<String, String>>{};
|
final thumbnails = <int, Map<String, String>>{};
|
||||||
|
|
||||||
XmpBasicNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
XmpBasicNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Basic';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool extractData(XmpProp prop) => extractIndexedStruct(prop, thumbnailsPattern, thumbnails);
|
bool extractData(XmpProp prop) => extractIndexedStruct(prop, thumbnailsPattern, thumbnails);
|
||||||
|
|
||||||
|
@ -51,10 +48,10 @@ class XmpMMNamespace extends XmpNamespace {
|
||||||
static const didPrefix = 'xmp.did:';
|
static const didPrefix = 'xmp.did:';
|
||||||
static const iidPrefix = 'xmp.iid:';
|
static const iidPrefix = 'xmp.iid:';
|
||||||
|
|
||||||
static final derivedFromPattern = RegExp(r'xmpMM:DerivedFrom/(.*)');
|
static final derivedFromPattern = RegExp(ns + r':DerivedFrom/(.*)');
|
||||||
static final historyPattern = RegExp(r'xmpMM:History\[(\d+)\]/(.*)');
|
static final historyPattern = RegExp(ns + r':History\[(\d+)\]/(.*)');
|
||||||
static final ingredientsPattern = RegExp(r'xmpMM:Ingredients\[(\d+)\]/(.*)');
|
static final ingredientsPattern = RegExp(ns + r':Ingredients\[(\d+)\]/(.*)');
|
||||||
static final pantryPattern = RegExp(r'xmpMM:Pantry\[(\d+)\]/(.*)');
|
static final pantryPattern = RegExp(ns + r':Pantry\[(\d+)\]/(.*)');
|
||||||
|
|
||||||
final derivedFrom = <String, String>{};
|
final derivedFrom = <String, String>{};
|
||||||
final history = <int, Map<String, String>>{};
|
final history = <int, Map<String, String>>{};
|
||||||
|
@ -63,9 +60,6 @@ class XmpMMNamespace extends XmpNamespace {
|
||||||
|
|
||||||
XmpMMNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
XmpMMNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
@override
|
|
||||||
String get displayTitle => 'Media Management';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool extractData(XmpProp prop) {
|
bool extractData(XmpProp prop) {
|
||||||
final hasStructs = extractStruct(prop, derivedFromPattern, derivedFrom);
|
final hasStructs = extractStruct(prop, derivedFromPattern, derivedFrom);
|
||||||
|
|
|
@ -59,11 +59,11 @@ class _XmpStructArrayCardState extends State<XmpStructArrayCard> {
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Expanded(
|
||||||
child: HighlightTitle(
|
child: HighlightTitle(
|
||||||
title: '${widget.title} ${_index + 1}',
|
title: '${widget.title} ${_index + 1}',
|
||||||
color: Colors.transparent,
|
|
||||||
selectable: true,
|
selectable: true,
|
||||||
|
showHighlight: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
@ -128,8 +128,8 @@ class XmpStructCard extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
HighlightTitle(
|
HighlightTitle(
|
||||||
title: title,
|
title: title,
|
||||||
color: Colors.transparent,
|
|
||||||
selectable: true,
|
selectable: true,
|
||||||
|
showHighlight: false,
|
||||||
),
|
),
|
||||||
InfoRowGroup(
|
InfoRowGroup(
|
||||||
info: struct,
|
info: struct,
|
||||||
|
|
Loading…
Reference in a new issue