Shared - XMP Parsing Utilities

This directory contains shared TypeScript code used by both frontend and backend.

Files

  • types.ts - TypeScript interfaces and types
  • xmp-parser.ts - XMP parsing and conversion logic

XMP Parser

The parser handles Adobe XMP sidecar files and converts them to Lightroom configuration format.

Supported XMP Properties

The parser maps common Adobe Camera Raw settings to Lightroom equivalents:

Global Adjustments:

  • Exposure, Contrast, Highlights, Shadows, Whites, Blacks
  • Temperature, Tint, Vibrance, Saturation
  • Texture, Clarity, Dehaze

Color Adjustments (HSL):

  • Red, Orange, Yellow, Green, Aqua, Blue, Purple, Magenta
  • Hue, Saturation, and Luminance for each color

Vignette Settings:

  • Amount, Midpoint, Feather, Roundness, Style

Value Normalization

The parser normalizes XMP values to match Lightroom's expected ranges:

  • Percentages (0-100) → Decimals (0.0-1.0)
  • Temperature values scaled appropriately
  • Curve adjustments converted to decimal format

Output Format

Generates configuration in the format:

LIGHTROOM_PROPERTY_NAME=value

All numeric values are formatted to 6 decimal places for consistency.