PM-.snap-Import (FieldsToApply, Merge, Aufnahmedatum), Aufnahmeort/Copyright-Status/DataMining, FTP-Profile Beautiful Sports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
1 parent
0b41f09206
commit
42ab9c9361
13 files changed
+472
-39
No files matched your search
@@ -9,12 +9,13 @@ public enum XMPNamespace {
|
||||
public static let xmpRights = "http://ns.adobe.com/xap/1.0/rights/"
|
||||
public static let xmp = "http://ns.adobe.com/xap/1.0/"
|
||||
public static let photomechanic = "http://ns.camerabits.com/photomechanic/1.0/"
|
||||
public static let plus = "http://ns.useplus.org/ldf/xmp/1.0/"
|
||||
public static let rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
/// Prefix normally used when we write a template file back out.
|
||||
public static let preferredPrefix: [String: String] = [
|
||||
dc: "dc", photoshop: "photoshop", iptcCore: "Iptc4xmpCore", iptcExt: "Iptc4xmpExt",
|
||||
xmpRights: "xmpRights", xmp: "xmp", photomechanic: "photomechanic",
|
||||
xmpRights: "xmpRights", xmp: "xmp", photomechanic: "photomechanic", plus: "plus",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ public enum IPTCFieldKind: String, Codable, Sendable {
|
||||
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)"
|
||||
@@ -108,6 +110,20 @@ public extension IPTCField {
|
||||
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,
|
||||
iim: "IPTC:By-line", xmp: "XMP-dc:Creator", ns: XMPNamespace.dc, local: "creator", container: .seq, max: 32),
|
||||
@@ -119,6 +135,10 @@ public extension IPTCField {
|
||||
iim: "IPTC:Source", xmp: "XMP-photoshop:Source", ns: XMPNamespace.photoshop, local: "Source", max: 32),
|
||||
f("copyright", "Copyright-Vermerk", pm: "Copyright Notice", .creator,
|
||||
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,
|
||||
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,
|
||||
iim: nil, xmp: "XMP-xmpRights:UsageTerms", ns: XMPNamespace.xmpRights, local: "UsageTerms", container: .alt),
|
||||
f("webStatement", "Copyright-URL", pm: "Copyright Info URL", .creator,
|
||||
@@ -153,6 +173,19 @@ public extension IPTCField {
|
||||
iim: nil, xmp: "XMP-iptcExt:PersonInImage", ns: XMPNamespace.iptcExt, local: "PersonInImage", container: .bag),
|
||||
]
|
||||
|
||||
/// Key in exiftool's JSON output (a trailing "#" only disables print conversion).
|
||||
var xmpReadKey: String { xmpTag.hasSuffix("#") ? String(xmpTag.dropLast()) : xmpTag }
|
||||
|
||||
/// IIM dataset (record 2) per field. Photo Mechanic's .snap lists applied fields as
|
||||
/// 0x200 + dataset (e.g. 0x25a = 2:90 City).
|
||||
static let iimDataset: [String: Int] = [
|
||||
"objectName": 5, "urgency": 10, "category": 15, "supplementalCategories": 20, "keywords": 25,
|
||||
"instructions": 40, "dateCreated": 55, "creator": 80, "creatorJobTitle": 85, "city": 90,
|
||||
"sublocation": 92, "state": 95, "countryCode": 100, "country": 101, "transmissionReference": 103,
|
||||
"headline": 105, "credit": 110, "source": 115, "copyright": 116, "caption": 120, "captionWriter": 122,
|
||||
"intellectualGenre": 4, "subjectCode": 12,
|
||||
]
|
||||
|
||||
static let byID: [String: IPTCField] = Dictionary(uniqueKeysWithValues: all.map { ($0.id, $0) })
|
||||
|
||||
/// Lookup by XMP namespace + local name (used by the PM template importer).
|
||||
|
||||
Reference in new issue
Block a user