PM-Oberfläche: Favoriten/Navigator/Aufgaben, Tabs, PM-Filter, PM-Kacheln, IPTC-Layout wie PM, ⌘I Mass-Edit, ⌘U Upload, Code-Ersetzung live, 8 Farbklassen, paralleles + gecachtes Metadaten-Laden, BILDER/INPUT+SENT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
Lichtkasten DevandClaude Opus 5.5 committed 2026-11-03 23:51:33 +00:00
1 parent d100249c12
commit c0ee93995f
18 files changed
+1311 -515

No files matched your search

@@ -0,0 +1,69 @@
import Foundation
/// On-disk cache of exiftool results per folder (keyed by file size + modification date),
/// so re-opening a folder with thousands of images is instant – like PM's preview/metadata cache.
public final class MetadataCache: @unchecked Sendable {
public struct Entry: Codable, Sendable {
public var size: Int64
public var mtime: Double
public var sidecarMtime: Double?
public var file: [String: MetadataValue]
public var sidecar: [String: MetadataValue]?
}
private let url: URL
private var entries: [String: Entry] = [:]
private let lock = NSLock()
private var dirty = false
public static var directory: URL {
let d = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
.appendingPathComponent("Lichtkasten/metadata", isDirectory: true)
try? FileManager.default.createDirectory(at: d, withIntermediateDirectories: true)
return d
}
public init(folder: URL) {
// FNV-1a hash of the path as file name
var h: UInt64 = 0xcbf29ce484222325
for b in folder.standardizedFileURL.path.utf8 { h = (h ^ UInt64(b)) &* 0x100000001b3 }
url = MetadataCache.directory.appendingPathComponent(String(h, radix: 16) + ".json")
if let d = try? Data(contentsOf: url), let e = try? JSONDecoder().decode([String: Entry].self, from: d) {
entries = e
}
}
static func stamp(_ u: URL) -> (Int64, Double)? {
guard let a = try? FileManager.default.attributesOfItem(atPath: u.path) else { return nil }
let size = (a[.size] as? NSNumber)?.int64Value ?? 0
let m = (a[.modificationDate] as? Date)?.timeIntervalSince1970 ?? 0
return (size, m)
}
/// Valid cached entry for an item (file and sidecar unchanged), else nil.
public func lookup(_ item: PhotoItem) -> Entry? {
lock.lock(); let e = entries[item.primary.path]; lock.unlock()
guard let e, let (size, m) = MetadataCache.stamp(item.primary), size == e.size, m == e.mtime else { return nil }
if item.kind.usesSidecar {
let sm = MetadataCache.stamp(item.sidecarURL)?.1
if sm != e.sidecarMtime { return nil }
}
return e
}
public func store(_ item: PhotoItem, file: [String: MetadataValue], sidecar: [String: MetadataValue]?) {
guard let (size, m) = MetadataCache.stamp(item.primary) else { return }
let sm = item.kind.usesSidecar ? MetadataCache.stamp(item.sidecarURL)?.1 : nil
lock.lock()
entries[item.primary.path] = Entry(size: size, mtime: m, sidecarMtime: sm, file: file, sidecar: sidecar)
dirty = true
lock.unlock()
}
public func save() {
lock.lock(); defer { lock.unlock() }
guard dirty, let d = try? JSONEncoder().encode(entries) else { return }
try? d.write(to: url, options: .atomic)
dirty = false
}
}
@@ -29,21 +29,29 @@ public enum FileKind: String, Sendable, Codable {
public var supportsIIM: Bool { self == .jpeg || self == .tiff || self == .dng }
}
/// Photo Mechanic color classes 1–8 (keys 1–8). Classes 1–5 map to Lightroom's label colors.
public enum ColorLabel: String, CaseIterable, Codable, Sendable {
case red = "Red", yellow = "Yellow", green = "Green", blue = "Blue", purple = "Purple"
case cyan = "Cyan", orange = "Orange", gray = "Gray"
/// Value written to Lightroom's xmp:Label (LR default label set, German UI uses the same English keys
/// only if the label set is "Lightroom-Standard"; see README).
/// Value written to xmp:Label (Lightroom default label set understands Red…Purple).
public var xmpValue: String { rawValue }
/// Photo Mechanic color class number for compatibility.
/// Photo Mechanic color class number.
public var pmColorClass: Int { (ColorLabel.allCases.firstIndex(of: self) ?? 0) + 1 }
/// PM's default class names.
public var pmName: String {
["Winner", "Winner alt", "Superior", "Superior alt", "Typical", "Typical alt", "Extras", "Trash"][pmColorClass - 1]
}
public var germanName: String {
switch self {
case .red: return "Rot"
case .yellow: return "Gelb"
case .green: return "Grün"
case .blue: return "Blau"
case .purple: return "Lila"
case .purple: return "Magenta"
case .cyan: return "Cyan"
case .orange: return "Orange"
case .gray: return "Grau"
}
}
@@ -51,7 +59,8 @@ public enum ColorLabel: String, CaseIterable, Codable, Sendable {
let l = xmp.lowercased()
let map: [String: ColorLabel] = ["red": .red, "rot": .red, "yellow": .yellow, "gelb": .yellow,
"green": .green, "grün": .green, "blue": .blue, "blau": .blue,
"purple": .purple, "lila": .purple, "violett": .purple]
"purple": .purple, "lila": .purple, "violett": .purple, "magenta": .purple,
"cyan": .cyan, "orange": .orange, "gray": .gray, "grey": .gray, "grau": .gray]
guard let c = map[l] else { return nil }
self = c
}
@@ -132,8 +141,9 @@ public struct PhotoItem: Identifiable, Hashable, Sendable {
func xmp(_ tag: String) -> MetadataValue? { xmpSource[tag] ?? fileMeta[tag] }
rating = xmp("XMP-xmp:Rating")?.int ?? 0
label = xmp("XMP-xmp:Label").flatMap { ColorLabel(xmp: $0.string) }
?? xmp("XMP-photomech:ColorClass")?.int.flatMap { ColorLabel(pmColorClass: $0) }
// PM color class first (it knows all 8 classes), then Lightroom's label.
label = xmp("XMP-photomech:ColorClass")?.int.flatMap { ColorLabel(pmColorClass: $0) }
?? xmp("XMP-xmp:Label").flatMap { ColorLabel(xmp: $0.string) }
tagged = xmp("XMP-photomech:Tagged")?.bool ?? false
var values = IPTCValues()
@@ -119,9 +119,9 @@ public final class ExifTool: @unchecked Sendable {
/// Keys for IPTC/XMP keep their group ("IPTC:Keywords"), EXIF keys are plain ("Model").
public func readMetadata(files: [URL]) async throws -> [String: [String: MetadataValue]] {
guard !files.isEmpty else { return [:] }
var args = ["-json", "-G1", "-fast", "-a",
var args = ["-json", "-G1", "-fast2", "-a",
"-XMP-xmp:Rating#", "-XMP-xmp:Label", "-XMP-photomech:Tagged#", "-XMP-photomech:ColorClass#",
"-Make", "-Model", "-LensModel", "-LensID", "-SerialNumber", "-ISO", "-ExposureTime", "-FNumber",
"-Make", "-Model", "-LensModel", "-Lens", "-SerialNumber", "-ISO", "-ExposureTime", "-FNumber",
"-FocalLength", "-DateTimeOriginal", "-CreateDate", "-SubSecTimeOriginal", "-OffsetTimeOriginal", "-ImageWidth", "-ImageHeight",
"-Orientation#", "-Artist", "-GPSLatitude#", "-GPSLongitude#"]
for f in IPTCField.all {
@@ -152,7 +152,7 @@ public final class ExifTool: @unchecked Sendable {
}
/// JSON values coming back from exiftool.
public enum MetadataValue: Sendable, Hashable {
public enum MetadataValue: Sendable, Hashable, Codable {
case string(String)
case number(Double)
case bool(Bool)
@@ -202,3 +202,36 @@ public enum MetadataValue: Sendable, Hashable {
}
}
}
/// Several exiftool processes in parallel – reading 2000+ files is I/O + Perl bound, so this scales well on Apple Silicon.
public final class ExifToolPool: @unchecked Sendable {
public let workers: [ExifTool]
public init(executable: URL, count: Int = min(6, max(2, ProcessInfo.processInfo.activeProcessorCount / 2))) {
workers = (0..<count).map { _ in ExifTool(executable: executable) }
}
public var primary: ExifTool { workers[0] }
public func shutdown() { workers.forEach { $0.shutdown() } }
/// Reads file groups (RAW + its sidecar stay together) in chunks spread over all workers;
/// `onChunk` is called as results arrive.
public func readMetadata(groups: [[URL]], groupsPerChunk: Int = 50,
onChunk: @escaping @Sendable ([String: [String: MetadataValue]]) async -> Void) async {
let chunks: [[URL]] = stride(from: 0, to: groups.count, by: groupsPerChunk).map {
groups[$0..<min($0 + groupsPerChunk, groups.count)].flatMap { $0 }
}
await withTaskGroup(of: Void.self) { group in
for w in 0..<workers.count {
let worker = workers[w]
let mine = chunks.enumerated().filter { $0.offset % workers.count == w }.map(\.element)
group.addTask {
for chunk in mine {
if let meta = try? await worker.readMetadata(files: chunk) { await onChunk(meta) }
}
}
}
}
}
}
@@ -25,13 +25,21 @@ public enum IPTCFieldKind: String, Codable, Sendable {
case list // keywords etc. – stored as [String]
}
/// Sections in Photo Mechanic's IPTC window order. `column` places them like PM (left / right).
public enum IPTCSection: String, CaseIterable, Codable, Sendable {
case description = "Beschreibung"
case location = "Ort"
case locationCreated = "Aufnahmeort (IPTC Ext)"
case creator = "Urheber & Rechte"
case contact = "Kontakt des Urhebers"
case extended = "Erweitert (IPTC Core/Ext)"
case imageContent = "Image Content"
case imageRights = "Image Rights"
case contact = "Creator Contact Info"
case eventLocation = "Event and Location"
case locationCreated = "Locations Taken and Shown"
case status = "Status"
public var column: Int {
switch self {
case .imageContent, .imageRights, .contact: return 0
case .eventLocation, .locationCreated, .status: return 1
}
}
}
/// How an XMP property is stored inside rdf.
@@ -72,88 +80,58 @@ public extension IPTCField {
}
static let all: [IPTCField] = [
// --- Beschreibung ---
f("caption", "Bildunterschrift", pm: "Caption", .description, .multiline,
// --- imageContent ---
f("caption", "Beschreibung", pm: "Description/Caption", .imageContent, .multiline,
iim: "IPTC:Caption-Abstract", xmp: "XMP-dc:Description", ns: XMPNamespace.dc, local: "description", container: .alt, max: 2000),
f("captionWriter", "Verfasser Bildunterschrift", pm: "Caption Writer", .description,
f("altText", "Alt-Text", pm: "Alt Text", .imageContent, .multiline,
iim: nil, xmp: "XMP-iptcCore:AltTextAccessibility", ns: XMPNamespace.iptcCore, local: "AltTextAccessibility", container: .alt),
f("extDescription", "Erweiterte Beschreibung", pm: "Extended Desc", .imageContent, .multiline,
iim: nil, xmp: "XMP-iptcCore:ExtDescrAccessibility", ns: XMPNamespace.iptcCore, local: "ExtDescrAccessibility", container: .alt),
f("captionWriter", "Verfasser", pm: "Description Writers", .imageContent,
iim: "IPTC:Writer-Editor", xmp: "XMP-photoshop:CaptionWriter", ns: XMPNamespace.photoshop, local: "CaptionWriter", max: 32),
f("headline", "Überschrift", pm: "Headline", .description,
f("headline", "Überschrift", pm: "Headline", .imageContent, .multiline,
iim: "IPTC:Headline", xmp: "XMP-photoshop:Headline", ns: XMPNamespace.photoshop, local: "Headline", max: 256),
f("instructions", "Anweisungen", pm: "Special Instructions", .description, .multiline,
iim: "IPTC:SpecialInstructions", xmp: "XMP-photoshop:Instructions", ns: XMPNamespace.photoshop, local: "Instructions", max: 256),
f("transmissionReference", "Job-ID / Übertragungsreferenz", pm: "Transmission Reference", .description,
iim: "IPTC:OriginalTransmissionReference", xmp: "XMP-photoshop:TransmissionReference", ns: XMPNamespace.photoshop, local: "TransmissionReference", max: 32),
f("objectName", "Titel (Objektname)", pm: "Object Name", .description,
iim: "IPTC:ObjectName", xmp: "XMP-dc:Title", ns: XMPNamespace.dc, local: "title", container: .alt, max: 64),
f("keywords", "Stichwörter", pm: "Keywords", .description, .list,
f("keywords", "Stichwörter", pm: "Keywords", .imageContent, .list,
iim: "IPTC:Keywords", xmp: "XMP-dc:Subject", ns: XMPNamespace.dc, local: "subject", container: .bag, max: 64),
f("category", "Kategorie", pm: "Category", .description,
iim: "IPTC:Category", xmp: "XMP-photoshop:Category", ns: XMPNamespace.photoshop, local: "Category", max: 3),
f("supplementalCategories", "Zusatzkategorien", pm: "Supplemental Categories", .description, .list,
iim: "IPTC:SupplementalCategories", xmp: "XMP-photoshop:SupplementalCategories", ns: XMPNamespace.photoshop, local: "SupplementalCategories", container: .bag, max: 32),
f("urgency", "Dringlichkeit", pm: "Urgency", .description,
iim: "IPTC:Urgency", xmp: "XMP-photoshop:Urgency", ns: XMPNamespace.photoshop, local: "Urgency", max: 1),
f("dateCreated", "Erstellungsdatum (JJJJ-MM-TT)", pm: "Date Created", .description,
iim: "IPTC:DateCreated", xmp: "XMP-photoshop:DateCreated", ns: XMPNamespace.photoshop, local: "DateCreated", max: 8),
// --- Ort ---
f("event", "Ereignis", pm: "Event", .location,
iim: nil, xmp: "XMP-iptcExt:Event", ns: XMPNamespace.iptcExt, local: "Event", container: .alt),
f("sublocation", "Ortsdetail", pm: "Location / Sublocation", .location,
iim: "IPTC:Sub-location", xmp: "XMP-iptcCore:Location", ns: XMPNamespace.iptcCore, local: "Location", max: 32),
f("city", "Stadt", pm: "City", .location,
iim: "IPTC:City", xmp: "XMP-photoshop:City", ns: XMPNamespace.photoshop, local: "City", max: 32),
f("state", "Bundesland", pm: "State / Province", .location,
iim: "IPTC:Province-State", xmp: "XMP-photoshop:State", ns: XMPNamespace.photoshop, local: "State", max: 32),
f("country", "Land", pm: "Country", .location,
iim: "IPTC:Country-PrimaryLocationName", xmp: "XMP-photoshop:Country", ns: XMPNamespace.photoshop, local: "Country", max: 64),
f("countryCode", "Ländercode (ISO)", pm: "Country Code", .location,
iim: "IPTC:Country-PrimaryLocationCode", xmp: "XMP-iptcCore:CountryCode", ns: XMPNamespace.iptcCore, local: "CountryCode", max: 3),
// --- Aufnahmeort (Iptc4xmpExt:LocationCreated, Struktur in einer Bag) ---
f("lcSublocation", "Ortsdetail", pm: "Location Created: Sublocation", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedSublocation", ns: XMPNamespace.iptcExt, local: "Sublocation"),
f("lcCity", "Stadt", pm: "Location Created: City", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedCity", ns: XMPNamespace.iptcExt, local: "City"),
f("lcState", "Bundesland", pm: "Location Created: State/Province", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedProvinceState", ns: XMPNamespace.iptcExt, local: "ProvinceState"),
f("lcCountry", "Land", pm: "Location Created: Country", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedCountryName", ns: XMPNamespace.iptcExt, local: "CountryName"),
f("lcCountryCode", "Ländercode", pm: "Location Created: Country Code", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedCountryCode", ns: XMPNamespace.iptcExt, local: "CountryCode"),
f("lcWorldRegion", "Weltregion", pm: "Location Created: World Region", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedWorldRegion", ns: XMPNamespace.iptcExt, local: "WorldRegion"),
// --- Urheber & Rechte ---
f("creator", "Fotograf", pm: "Photographer / Creator", .creator,
f("personInImage", "Abgebildete Personen", pm: "Persons shown", .imageContent, .list,
iim: nil, xmp: "XMP-iptcExt:PersonInImage", ns: XMPNamespace.iptcExt, local: "PersonInImage", container: .bag),
f("orgName", "Organisation (Name)", pm: "Featured Org. Name", .imageContent, .list,
iim: nil, xmp: "XMP-iptcExt:OrganisationInImageName", ns: XMPNamespace.iptcExt, local: "OrganisationInImageName", container: .bag),
f("orgCode", "Organisation (Code)", pm: "Featured Org. Code", .imageContent, .list,
iim: nil, xmp: "XMP-iptcExt:OrganisationInImageCode", ns: XMPNamespace.iptcExt, local: "OrganisationInImageCode", container: .bag),
f("scene", "Szene", pm: "IPTC Scene", .imageContent, .list,
iim: nil, xmp: "XMP-iptcCore:Scene", ns: XMPNamespace.iptcCore, local: "Scene", container: .bag),
// --- imageRights ---
f("creator", "Fotograf", pm: "Creator/Photographer", .imageRights,
iim: "IPTC:By-line", xmp: "XMP-dc:Creator", ns: XMPNamespace.dc, local: "creator", container: .seq, max: 32),
f("creatorJobTitle", "Position des Fotografen", pm: "Photographer's Title", .creator,
f("creatorIdentity", "Urheber-ID", pm: "Creator's Identity", .imageRights,
iim: nil, xmp: "XMP-photomech:CreatorIdentity", ns: XMPNamespace.photomechanic, local: "CreatorIdentity"),
f("creatorJobTitle", "Position", pm: "Creator's Job Title", .imageRights,
iim: "IPTC:By-lineTitle", xmp: "XMP-photoshop:AuthorsPosition", ns: XMPNamespace.photoshop, local: "AuthorsPosition", max: 32),
f("credit", "Credit / Anbieter", pm: "Credit", .creator,
f("credit", "Credit", pm: "Credit Line", .imageRights,
iim: "IPTC:Credit", xmp: "XMP-photoshop:Credit", ns: XMPNamespace.photoshop, local: "Credit", max: 32),
f("source", "Quelle", pm: "Source", .creator,
f("source", "Quelle", pm: "Source", .imageRights,
iim: "IPTC:Source", xmp: "XMP-photoshop:Source", ns: XMPNamespace.photoshop, local: "Source", max: 32),
f("copyright", "Copyright-Vermerk", pm: "Copyright Notice", .creator,
f("copyright", "Copyright", pm: "Copyright Notice", .imageRights,
iim: "IPTC:CopyrightNotice", xmp: "XMP-dc:Rights", ns: XMPNamespace.dc, local: "rights", container: .alt, max: 128),
f("copyrightMarked", "Copyright-Status (True = geschützt)", pm: "Copyright Status", .creator,
f("copyrightMarked", "Copyright-Status", pm: "Copyright Status (True/False)", .imageRights,
iim: nil, xmp: "XMP-xmpRights:Marked", ns: XMPNamespace.xmpRights, local: "Marked"),
f("dataMining", "Data Mining (PLUS)", pm: "Data Mining", .creator,
iim: nil, xmp: "XMP-plus:DataMining#", ns: XMPNamespace.plus, local: "DataMining"),
f("usageTerms", "Nutzungsbedingungen", pm: "Rights Usage Terms", .creator, .multiline,
f("usageTerms", "Nutzungsbedingungen", pm: "Rights Usage Terms", .imageRights, .multiline,
iim: nil, xmp: "XMP-xmpRights:UsageTerms", ns: XMPNamespace.xmpRights, local: "UsageTerms", container: .alt),
f("webStatement", "Copyright-URL", pm: "Copyright Info URL", .creator,
f("webStatement", "Copyright-URL", pm: "Copyright Info URL", .imageRights,
iim: nil, xmp: "XMP-xmpRights:WebStatement", ns: XMPNamespace.xmpRights, local: "WebStatement"),
// --- Kontakt (IPTC Core CreatorContactInfo) ---
f("dataMining", "Data Mining", pm: "Data Mining (PLUS)", .imageRights,
iim: nil, xmp: "XMP-plus:DataMining#", ns: XMPNamespace.plus, local: "DataMining"),
// --- contact ---
f("ciAddress", "Adresse", pm: "Address", .contact,
iim: nil, xmp: "XMP-iptcCore:CreatorAddress", ns: XMPNamespace.iptcCore, local: "CiAdrExtadr"),
f("ciCity", "Stadt", pm: "City (Contact)", .contact,
f("ciCity", "Stadt", pm: "City", .contact,
iim: nil, xmp: "XMP-iptcCore:CreatorCity", ns: XMPNamespace.iptcCore, local: "CiAdrCity"),
f("ciRegion", "Bundesland", pm: "State (Contact)", .contact,
f("ciRegion", "Bundesland", pm: "State/Province", .contact,
iim: nil, xmp: "XMP-iptcCore:CreatorRegion", ns: XMPNamespace.iptcCore, local: "CiAdrRegion"),
f("ciPostalCode", "PLZ", pm: "Postal Code", .contact,
iim: nil, xmp: "XMP-iptcCore:CreatorPostalCode", ns: XMPNamespace.iptcCore, local: "CiAdrPcode"),
f("ciCountry", "Land", pm: "Country (Contact)", .contact,
f("ciCountry", "Land", pm: "Country", .contact,
iim: nil, xmp: "XMP-iptcCore:CreatorCountry", ns: XMPNamespace.iptcCore, local: "CiAdrCtry"),
f("ciPhone", "Telefon", pm: "Phone", .contact,
iim: nil, xmp: "XMP-iptcCore:CreatorWorkTelephone", ns: XMPNamespace.iptcCore, local: "CiTelWork"),
@@ -161,16 +139,53 @@ public extension IPTCField {
iim: nil, xmp: "XMP-iptcCore:CreatorWorkEmail", ns: XMPNamespace.iptcCore, local: "CiEmailWork"),
f("ciURL", "Website", pm: "Web URL", .contact,
iim: nil, xmp: "XMP-iptcCore:CreatorWorkURL", ns: XMPNamespace.iptcCore, local: "CiUrlWork"),
// --- Erweitert ---
f("intellectualGenre", "Genre", pm: "Intellectual Genre", .extended,
iim: "IPTC:ObjectAttributeReference", xmp: "XMP-iptcCore:IntellectualGenre", ns: XMPNamespace.iptcCore, local: "IntellectualGenre", max: 68),
f("scene", "Szenen-Code", pm: "IPTC Scene", .extended, .list,
iim: nil, xmp: "XMP-iptcCore:Scene", ns: XMPNamespace.iptcCore, local: "Scene", container: .bag),
f("subjectCode", "Themen-Code", pm: "IPTC Subject Code", .extended, .list,
// --- eventLocation ---
f("event", "Ereignis", pm: "Event", .eventLocation,
iim: nil, xmp: "XMP-iptcExt:Event", ns: XMPNamespace.iptcExt, local: "Event", container: .alt),
f("dateCreated", "Datum", pm: "Date", .eventLocation,
iim: "IPTC:DateCreated", xmp: "XMP-photoshop:DateCreated", ns: XMPNamespace.photoshop, local: "DateCreated", max: 8),
f("city", "Stadt", pm: "City", .eventLocation,
iim: "IPTC:City", xmp: "XMP-photoshop:City", ns: XMPNamespace.photoshop, local: "City", max: 32),
f("sublocation", "Ort", pm: "Location", .eventLocation,
iim: "IPTC:Sub-location", xmp: "XMP-iptcCore:Location", ns: XMPNamespace.iptcCore, local: "Location", max: 32),
f("state", "Bundesland", pm: "State/Province", .eventLocation,
iim: "IPTC:Province-State", xmp: "XMP-photoshop:State", ns: XMPNamespace.photoshop, local: "State", max: 32),
f("country", "Land", pm: "Country", .eventLocation,
iim: "IPTC:Country-PrimaryLocationName", xmp: "XMP-photoshop:Country", ns: XMPNamespace.photoshop, local: "Country", max: 64),
f("countryCode", "Ländercode", pm: "ISO Country Code", .eventLocation,
iim: "IPTC:Country-PrimaryLocationCode", xmp: "XMP-iptcCore:CountryCode", ns: XMPNamespace.iptcCore, local: "CountryCode", max: 3),
f("subjectCode", "Themen-Code", pm: "IPTC Subject Code", .eventLocation, .list,
iim: "IPTC:SubjectReference", xmp: "XMP-iptcCore:SubjectCode", ns: XMPNamespace.iptcCore, local: "SubjectCode", container: .bag, max: 236),
f("personInImage", "Abgebildete Personen", pm: "Person Shown", .extended, .list,
iim: nil, xmp: "XMP-iptcExt:PersonInImage", ns: XMPNamespace.iptcExt, local: "PersonInImage", container: .bag),
f("intellectualGenre", "Genre", pm: "Intellectual Genre", .eventLocation,
iim: "IPTC:ObjectAttributeReference", xmp: "XMP-iptcCore:IntellectualGenre", ns: XMPNamespace.iptcCore, local: "IntellectualGenre", max: 68),
// --- locationCreated ---
f("lcSublocation", "Ortsdetail", pm: "Sublocation", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedSublocation", ns: XMPNamespace.iptcExt, local: "Sublocation"),
f("lcCity", "Stadt", pm: "City", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedCity", ns: XMPNamespace.iptcExt, local: "City"),
f("lcState", "Bundesland", pm: "State", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedProvinceState", ns: XMPNamespace.iptcExt, local: "ProvinceState"),
f("lcCountry", "Land", pm: "Country", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedCountryName", ns: XMPNamespace.iptcExt, local: "CountryName"),
f("lcCountryCode", "Ländercode", pm: "Country Code", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedCountryCode", ns: XMPNamespace.iptcExt, local: "CountryCode"),
f("lcWorldRegion", "Weltregion", pm: "World Region", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedWorldRegion", ns: XMPNamespace.iptcExt, local: "WorldRegion"),
f("lcLocationId", "Orts-ID", pm: "Location ID", .locationCreated,
iim: nil, xmp: "XMP-iptcExt:LocationCreatedLocationId", ns: XMPNamespace.iptcExt, local: "LocationId"),
// --- status ---
f("objectName", "Titel", pm: "Title", .status,
iim: "IPTC:ObjectName", xmp: "XMP-dc:Title", ns: XMPNamespace.dc, local: "title", container: .alt, max: 64),
f("transmissionReference", "Job-ID", pm: "Job Identifier", .status,
iim: "IPTC:OriginalTransmissionReference", xmp: "XMP-photoshop:TransmissionReference", ns: XMPNamespace.photoshop, local: "TransmissionReference", max: 32),
f("instructions", "Anweisungen", pm: "Instructions", .status, .multiline,
iim: "IPTC:SpecialInstructions", xmp: "XMP-photoshop:Instructions", ns: XMPNamespace.photoshop, local: "Instructions", max: 256),
f("urgency", "Dringlichkeit", pm: "Urgency", .status,
iim: "IPTC:Urgency", xmp: "XMP-photoshop:Urgency", ns: XMPNamespace.photoshop, local: "Urgency", max: 1),
f("category", "Kategorie", pm: "Category", .status,
iim: "IPTC:Category", xmp: "XMP-photoshop:Category", ns: XMPNamespace.photoshop, local: "Category", max: 3),
f("supplementalCategories", "Zusatzkategorien", pm: "Supplemental Categories", .status, .list,
iim: "IPTC:SupplementalCategories", xmp: "XMP-photoshop:SupplementalCategories", ns: XMPNamespace.photoshop, local: "SupplementalCategories", container: .bag, max: 32),
]
/// Key in exiftool's JSON output (a trailing "#" only disables print conversion).