minor fixes

This commit is contained in:
Thibault Deckers 2020-11-20 15:29:29 +09:00
parent edc90f085c
commit 3fb3cf1f88
3 changed files with 22 additions and 10 deletions

View file

@ -44,14 +44,21 @@ class MimeTypes {
static const List<String> undecodable = [crw, psd]; // TODO TLAD make it dynamic if it depends on OS/lib versions
static String displayType(String mime) {
switch (mime) {
case 'image/x-icon':
return 'ICO';
case 'image/vnd.adobe.photoshop':
case 'image/x-photoshop':
return 'PSD';
default:
final patterns = [
RegExp('.*/'), // remove type, keep subtype
RegExp('(X-|VND.(WAP.)?)'), // noisy prefixes
'+XML', // noisy suffix
RegExp('ADOBE\\\.'), // for PSD
];
mime = mime.toUpperCase();
patterns.forEach((pattern) => mime = mime.replaceFirst(pattern, ''));
return mime;
}
}
}

View file

@ -2,7 +2,9 @@ class XMP {
static const namespaceSeparator = ':';
static const structFieldSeparator = '/';
// cf https://exiftool.org/TagNames/XMP.html
static const Map<String, String> namespaces = {
'aux': 'Auxiliary Exif',
'Camera': 'Camera',
'crs': 'Camera Raw Settings',
'dc': 'Dublin Core',
@ -12,6 +14,7 @@ class XMP {
'Iptc4xmpCore': 'IPTC Core',
'lr': 'Lightroom',
'MicrosoftPhoto': 'Microsoft Photo',
'panorama': 'Panorama',
'pdf': 'PDF',
'pdfx': 'PDF/X',
'photomechanic': 'Photo Mechanic',

View file

@ -15,7 +15,9 @@ class ErrorThumbnail extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
return Container(
alignment: Alignment.center,
color: Colors.black,
child: Tooltip(
message: tooltip,
preferBelow: false,