Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
378 changes: 375 additions & 3 deletions src-tauri/src/metadata/embedded.rs

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions src-tauri/src/metadata/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ pub(super) enum DetailSection {
Source,
Capture,
Location,
CameraSettings,
}

impl DetailSection {
Expand All @@ -156,11 +157,14 @@ impl DetailSection {
"source" => Some(Self::Source),
"capture" => Some(Self::Capture),
"location" => Some(Self::Location),
"cameraSettings" => Some(Self::CameraSettings),
_ => None,
}
}
}

pub(super) const FUJIFILM_MAKER_GROUPS: &[(&str, &str)] = &[("MakerNotes", "FujiFilm")];

/// Detail keys are the existing frontend contract. Original descriptions remain
/// separate from editable catalog descriptions.
pub(super) struct DetailField {
Expand All @@ -170,6 +174,9 @@ pub(super) struct DetailField {
pub stored: bool,
pub descriptive: bool,
pub section: Option<DetailSection>,
/// When `Some`, restricts tag matching strictly to `(family0, family1)` pairs
/// instead of `SOURCE_PRIORITY` / `TECHNICAL_GROUPS`.
pub allowed_groups: Option<&'static [(&'static str, &'static str)]>,
}

pub(super) const DETAIL_FIELDS: &[DetailField] = &[
Expand All @@ -184,6 +191,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "headline",
Expand All @@ -192,6 +200,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "creator",
Expand All @@ -204,6 +213,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "copyright",
Expand All @@ -216,6 +226,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "description",
Expand All @@ -228,6 +239,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "credit",
Expand All @@ -240,6 +252,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "source",
Expand All @@ -252,6 +265,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "usageTerms",
Expand All @@ -264,6 +278,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "rightsUrl",
Expand All @@ -276,6 +291,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "software",
Expand All @@ -288,6 +304,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: true,
section: Some(DetailSection::Source),
allowed_groups: None,
},
DetailField {
key: "flash",
Expand All @@ -296,6 +313,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Capture),
allowed_groups: None,
},
DetailField {
key: "whiteBalance",
Expand All @@ -304,6 +322,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Capture),
allowed_groups: None,
},
DetailField {
key: "exposureMode",
Expand All @@ -312,6 +331,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Capture),
allowed_groups: None,
},
DetailField {
key: "exposureProgram",
Expand All @@ -320,6 +340,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Capture),
allowed_groups: None,
},
DetailField {
key: "meteringMode",
Expand All @@ -328,6 +349,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Capture),
allowed_groups: None,
},
DetailField {
key: "focalLength35mm",
Expand All @@ -336,6 +358,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Capture),
allowed_groups: None,
},
DetailField {
key: "timeZone",
Expand All @@ -344,6 +367,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Capture),
allowed_groups: None,
},
DetailField {
key: "direction",
Expand All @@ -352,6 +376,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Location),
allowed_groups: None,
},
DetailField {
key: "directionRef",
Expand All @@ -360,6 +385,143 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: false,
descriptive: false,
section: Some(DetailSection::Location),
allowed_groups: None,
},
// Camera Settings (MakerNotes-scoped, read-only, never stored in catalog rows)
DetailField {
key: "filmSimulation",
backend_names: &["FilmMode"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "dynamicRange",
backend_names: &[],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "highlightTone",
backend_names: &["HighlightTone"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "shadowTone",
backend_names: &["ShadowTone"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "saturation",
backend_names: &["Saturation"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "sharpness",
backend_names: &["Sharpness"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "noiseReduction",
backend_names: &["NoiseReduction"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "clarity",
backend_names: &["Clarity"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "whiteBalanceShift",
backend_names: &["WhiteBalanceFineTune"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "grainEffect",
backend_names: &[],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "colorChromeEffect",
backend_names: &["ColorChromeEffect"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "colorChromeFxBlue",
backend_names: &["ColorChromeFXBlue"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "focusMode",
backend_names: &["FocusMode"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "driveMode",
backend_names: &["DriveMode"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "imageStabilization",
backend_names: &["ImageStabilization"],
xmp: None,
stored: false,
descriptive: false,
section: Some(DetailSection::CameraSettings),
allowed_groups: Some(FUJIFILM_MAKER_GROUPS),
},
DetailField {
key: "iccProfile",
Expand All @@ -368,6 +530,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: false,
section: None,
allowed_groups: None,
},
DetailField {
key: "colorSpace",
Expand All @@ -376,6 +539,7 @@ pub(super) const DETAIL_FIELDS: &[DetailField] = &[
stored: true,
descriptive: false,
section: None,
allowed_groups: None,
},
];

Expand Down
8 changes: 8 additions & 0 deletions src-vite/src/common/fileInfoFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ export const fileInfoFieldGroups = [
...fields('capture', ['taken_at', 'camera', 'lens', 'capture_settings']),
...fields('capture', ['flash', 'whiteBalance', 'exposureMode', 'exposureProgram', 'meteringMode', 'focalLength35mm', 'timeZone'], true),
] },
{ key: 'cameraSettings', label: 'file_info.camera_settings', fields: [
...fields('cameraSettings', [
'filmSimulation', 'dynamicRange', 'highlightTone', 'shadowTone',
'saturation', 'sharpness', 'noiseReduction', 'clarity',
'whiteBalanceShift', 'grainEffect', 'colorChromeEffect', 'colorChromeFxBlue',
'focusMode', 'driveMode', 'imageStabilization',
], true),
] },
{ key: 'location', label: 'file_info.geo_location', fields: [
...fields('location', ['geo_location']),
{ key: 'location.gps', label: 'GPS' },
Expand Down
Loading