info: improved some xmp display
This commit is contained in:
parent
34f8b9cef9
commit
22c6e5641c
1 changed files with 21 additions and 1 deletions
|
@ -1,11 +1,31 @@
|
||||||
// cf photoshop:ColorMode
|
// cf photoshop:ColorMode
|
||||||
// cf https://github.com/adobe/xmp-docs/blob/master/XMPNamespaces/photoshop.md
|
// cf https://github.com/adobe/xmp-docs/blob/master/XMPNamespaces/photoshop.md
|
||||||
import 'package:aves/widgets/viewer/info/metadata/xmp_namespaces.dart';
|
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 XmpPhotoshopNamespace extends XmpNamespace {
|
class XmpPhotoshopNamespace extends XmpNamespace {
|
||||||
static const ns = 'photoshop';
|
static const ns = 'photoshop';
|
||||||
|
|
||||||
const XmpPhotoshopNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
static final textLayersPattern = RegExp(ns + r':TextLayers\[(\d+)\]/(.*)');
|
||||||
|
|
||||||
|
final textLayers = <int, Map<String, String>>{};
|
||||||
|
|
||||||
|
XmpPhotoshopNamespace(Map<String, String> rawProps) : super(ns, rawProps);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool extractData(XmpProp prop) {
|
||||||
|
return extractIndexedStruct(prop, textLayersPattern, textLayers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Widget> buildFromExtractedData() => [
|
||||||
|
if (textLayers.isNotEmpty)
|
||||||
|
XmpStructArrayCard(
|
||||||
|
title: 'Text Layers',
|
||||||
|
structByIndex: textLayers,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String formatValue(XmpProp prop) {
|
String formatValue(XmpProp prop) {
|
||||||
|
|
Loading…
Reference in a new issue