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
261 changes: 234 additions & 27 deletions src-tauri/src/metadata/embedded.rs

Large diffs are not rendered by default.

307 changes: 246 additions & 61 deletions src-tauri/src/metadata/schema.rs

Large diffs are not rendered by default.

64 changes: 56 additions & 8 deletions src-vite/src/common/fileInfoFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,61 @@ export const editableMetadataFields = [
{ key: 'e_copyright', label: 'file_info.detail_fields.copyright' },
] as const;

export type CameraSettingsBrand = 'fujifilm' | 'canon' | 'nikon' | 'sony' | 'panasonic';

export const cameraSettingsBrands: ReadonlyArray<{ key: CameraSettingsBrand; label: string }> = [
{ key: 'fujifilm', label: 'Fujifilm' },
{ key: 'canon', label: 'Canon' },
{ key: 'nikon', label: 'Nikon' },
{ key: 'sony', label: 'Sony' },
{ key: 'panasonic', label: 'Panasonic / Leica' },
];

const ALL_CAMERA_BRANDS: readonly CameraSettingsBrand[] = ['fujifilm', 'canon', 'nikon', 'sony', 'panasonic'];

const cameraSettingsFieldDefs: ReadonlyArray<{ key: string; brands: readonly CameraSettingsBrand[] }> = [
{ key: 'filmSimulation', brands: ['fujifilm'] },
{ key: 'pictureStyle', brands: ['canon'] },
{ key: 'pictureControl', brands: ['nikon'] },
{ key: 'creativeStyle', brands: ['sony'] },
{ key: 'pictureProfile', brands: ['sony'] },
{ key: 'pictureEffect', brands: ['sony'] },
{ key: 'photoStyle', brands: ['panasonic'] },
{ key: 'dynamicRange', brands: ['fujifilm'] },
{ key: 'autoLightingOptimizer', brands: ['canon'] },
{ key: 'highlightTonePriority', brands: ['canon'] },
{ key: 'activeDLighting', brands: ['nikon'] },
{ key: 'dynamicRangeOptimizer', brands: ['sony'] },
{ key: 'intelligentDRange', brands: ['panasonic'] },
{ key: 'highlightTone', brands: ['fujifilm'] },
{ key: 'shadowTone', brands: ['fujifilm'] },
{ key: 'contrast', brands: ALL_CAMERA_BRANDS },
{ key: 'saturation', brands: ALL_CAMERA_BRANDS },
{ key: 'sharpness', brands: ALL_CAMERA_BRANDS },
{ key: 'noiseReduction', brands: ALL_CAMERA_BRANDS },
{ key: 'clarity', brands: ['fujifilm', 'nikon'] },
{ key: 'whiteBalanceShift', brands: ALL_CAMERA_BRANDS },
{ key: 'grainEffect', brands: ['fujifilm'] },
{ key: 'colorChromeEffect', brands: ['fujifilm'] },
{ key: 'colorChromeFxBlue', brands: ['fujifilm'] },
{ key: 'focusMode', brands: ALL_CAMERA_BRANDS },
{ key: 'driveMode', brands: ['fujifilm', 'canon', 'nikon', 'sony'] },
{ key: 'imageStabilization', brands: ALL_CAMERA_BRANDS },
{ key: 'shutterCount', brands: ['nikon', 'sony'] },
];

export const cameraSettingsFields = cameraSettingsFieldDefs.map(({ key, brands }) => ({
key: `cameraSettings.${key}`,
label: `file_info.detail_fields.${key}`,
brands,
}));

export function filterCameraSettingsFields(brand: 'all' | CameraSettingsBrand) {
return brand === 'all'
? cameraSettingsFields
: cameraSettingsFields.filter(field => field.brands.includes(brand));
}

// Field choices are independent of section expansion.
const fields = (section: string, keys: string[], details = false) => keys.map(key => ({
key: `${section}.${key}`,
Expand All @@ -24,14 +79,7 @@ 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: 'cameraSettings', label: 'file_info.camera_settings', fields: cameraSettingsFields },
{ key: 'location', label: 'file_info.geo_location', fields: [
...fields('location', ['geo_location']),
{ key: 'location.gps', label: 'GPS' },
Expand Down
7 changes: 4 additions & 3 deletions src-vite/src/components/FileInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,11 @@ const detailKeys: Record<DetailSection, string[]> = {
capture: ['flash', 'whiteBalance', 'exposureMode', 'exposureProgram', 'meteringMode', 'focalLength35mm', 'timeZone'],
location: ['direction', 'directionRef'],
cameraSettings: [
'filmSimulation', 'dynamicRange', 'highlightTone', 'shadowTone',
'saturation', 'sharpness', 'noiseReduction', 'clarity',
'filmSimulation', 'pictureStyle', 'pictureControl', 'creativeStyle', 'pictureProfile', 'pictureEffect', 'photoStyle',
'dynamicRange', 'autoLightingOptimizer', 'highlightTonePriority', 'activeDLighting', 'dynamicRangeOptimizer', 'intelligentDRange',
'highlightTone', 'shadowTone', 'contrast', 'saturation', 'sharpness', 'noiseReduction', 'clarity',
'whiteBalanceShift', 'grainEffect', 'colorChromeEffect', 'colorChromeFxBlue',
'focusMode', 'driveMode', 'imageStabilization',
'focusMode', 'driveMode', 'imageStabilization', 'shutterCount',
],
};
const sourceFallbacks: Record<string, string> = { title: 'e_title', headline: 'e_headline', creator: 'e_artist', copyright: 'e_copyright', software: 'e_software' };
Expand Down
58 changes: 55 additions & 3 deletions src-vite/src/components/FileInfoFieldsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,33 @@
</label>
</section>
<section v-for="group in fileInfoFieldGroups" :key="group.key" class="rounded-box p-2 space-y-2 bg-base-300/30 border border-base-content/5 shadow-sm" :aria-labelledby="`info-fields-${group.key}`">
<h2 :id="`info-fields-${group.key}`" class="flex items-center font-bold uppercase text-[10px] tracking-widest text-base-content/30">{{ $t(group.label) }}</h2>
<div class="flex items-center justify-between gap-2">
<h2 :id="`info-fields-${group.key}`" class="flex items-center font-bold uppercase text-[10px] tracking-widest text-base-content/30">{{ $t(group.label) }}</h2>
<button
v-if="group.key === 'cameraSettings'"
type="button"
class="text-[11px] text-primary hover:underline cursor-pointer"
@click="toggleVisibleCameraSettings"
>
{{ allVisibleCameraSettingsSelected ? $t('menu.select.none') : $t('menu.select.all') }}
</button>
</div>
<div v-if="group.key === 'cameraSettings'" class="flex flex-wrap gap-1">
<button
v-for="brand in cameraBrandFilterOptions"
:key="brand.key"
type="button"
class="px-2 py-0.5 rounded-full text-[11px] transition-colors cursor-pointer"
:class="selectedCameraBrand === brand.key
? 'bg-primary text-primary-content font-medium'
: 'bg-base-content/10 text-base-content/70 hover:bg-base-content/15'"
@click="selectedCameraBrand = brand.key"
>
{{ brand.key === 'all' ? $t('file_info.all_brands') : brand.label }}
</button>
</div>
<div class="grid grid-cols-2 gap-x-3 gap-y-2">
<label v-for="field in group.fields" :key="field.key" class="flex items-center gap-2 text-xs">
<label v-for="field in visibleFieldsFor(group)" :key="field.key" class="flex items-center gap-2 text-xs">
<input type="checkbox" class="checkbox checkbox-primary checkbox-sm shrink-0"
:checked="selected.includes(field.key)"
@change="toggle(field.key, ($event.target as HTMLInputElement).checked)" />
Expand All @@ -38,12 +62,40 @@
import { computed, ref, watch, onMounted, onBeforeUnmount } from 'vue';
import ModalDialog from '@/components/ModalDialog.vue';
import { config } from '@/common/config';
import { fileInfoFieldGroups, allFileInfoFields, defaultFileInfoFields, normalizeFileInfoFields } from '@/common/fileInfoFields';
import {
fileInfoFieldGroups,
allFileInfoFields,
defaultFileInfoFields,
normalizeFileInfoFields,
cameraSettingsBrands,
filterCameraSettingsFields,
type CameraSettingsBrand,
} from '@/common/fileInfoFields';
import { useUIStore } from '@/stores/uiStore';

const emit = defineEmits(['cancel']);
const uiStore = useUIStore();
const selected = computed(() => normalizeFileInfoFields(config.infoPanel.fields));
const selectedCameraBrand = ref<'all' | CameraSettingsBrand>('all');
const cameraBrandFilterOptions: ReadonlyArray<{ key: 'all' | CameraSettingsBrand; label: string }> = [
{ key: 'all', label: 'All' },
...cameraSettingsBrands,
];
const visibleCameraSettingsFields = computed(() => filterCameraSettingsFields(selectedCameraBrand.value));
const allVisibleCameraSettingsSelected = computed(() =>
visibleCameraSettingsFields.value.length > 0
&& visibleCameraSettingsFields.value.every(field => selected.value.includes(field.key))
);
function visibleFieldsFor(group: (typeof fileInfoFieldGroups)[number]) {
return group.key === 'cameraSettings' ? visibleCameraSettingsFields.value : group.fields;
}
function toggleVisibleCameraSettings() {
const keys = visibleCameraSettingsFields.value.map(field => field.key);
const next = allVisibleCameraSettingsSelected.value
? selected.value.filter(key => !keys.includes(key))
: [...selected.value, ...keys];
config.infoPanel.fields = normalizeFileInfoFields(next);
}
const matchesFields = (fields: string[]) => selected.value.length === fields.length && fields.every(key => selected.value.includes(key));
const preset = ref(matchesFields(defaultFileInfoFields) ? 'default' : matchesFields(allFileInfoFields) ? 'all' : 'custom');
watch(selected, () => { preset.value = 'custom'; }, { flush: 'sync' });
Expand Down
18 changes: 16 additions & 2 deletions src-vite/src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,26 @@
"colorChromeFxBlue": "Color Chrome Modrá",
"focusMode": "Režim ostření",
"driveMode": "Režim snímání",
"imageStabilization": "Stabilizace"
"imageStabilization": "Stabilizace",
"pictureStyle": "Picture Style",
"pictureControl": "Picture Control",
"creativeStyle": "Kreativní styl",
"pictureProfile": "Profil obrazu",
"pictureEffect": "Obrazový efekt",
"photoStyle": "Styl fotografie",
"autoLightingOptimizer": "Auto Lighting Optimizer",
"highlightTonePriority": "Priorita jasů",
"activeDLighting": "Active D-Lighting",
"dynamicRangeOptimizer": "Optimalizace dynamického rozsahu",
"intelligentDRange": "Inteligentní dynamický rozsah",
"contrast": "Kontrast",
"shutterCount": "Počet expozic"
},
"metadata_details_retry": "Metadata se nepodařilo načíst. Klikněte pro nový pokus.",
"true_north": "Zeměpisný sever",
"magnetic_north": "Magnetický sever",
"camera_settings": "Nastavení fotoaparátu"
"camera_settings": "Nastavení fotoaparátu",
"all_brands": "Vše"
},
"map": {
"show_map": "Zobrazit mapu",
Expand Down
18 changes: 16 additions & 2 deletions src-vite/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,26 @@
"colorChromeFxBlue": "Color Chrome Blau",
"focusMode": "Fokusmodus",
"driveMode": "Auslösemodus",
"imageStabilization": "Stabilisierung"
"imageStabilization": "Stabilisierung",
"pictureStyle": "Bildstil",
"pictureControl": "Picture Control",
"creativeStyle": "Kreativmodus",
"pictureProfile": "Bildprofil",
"pictureEffect": "Bildeffekt",
"photoStyle": "Fotostil",
"autoLightingOptimizer": "Autom. Belichtungsoptimierung",
"highlightTonePriority": "Tonwert Priorität",
"activeDLighting": "Active D-Lighting",
"dynamicRangeOptimizer": "D-Bereichsoptimierer",
"intelligentDRange": "Intelligenter Dynamikbereich",
"contrast": "Kontrast",
"shutterCount": "Auslösungen"
},
"metadata_details_retry": "Metadaten konnten nicht gelesen werden. Zum Wiederholen klicken.",
"true_north": "Geografischer Norden",
"magnetic_north": "Magnetischer Norden",
"camera_settings": "Kameraeinstellungen"
"camera_settings": "Kameraeinstellungen",
"all_brands": "Alle"
},
"map": {
"show_map": "Karte anzeigen",
Expand Down
18 changes: 16 additions & 2 deletions src-vite/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,26 @@
"colorChromeFxBlue": "Color Chrome Blue",
"focusMode": "Focus mode",
"driveMode": "Drive mode",
"imageStabilization": "Stabilization"
"imageStabilization": "Stabilization",
"pictureStyle": "Picture style",
"pictureControl": "Picture control",
"creativeStyle": "Creative style",
"pictureProfile": "Picture profile",
"pictureEffect": "Picture effect",
"photoStyle": "Photo style",
"autoLightingOptimizer": "Auto lighting optimizer",
"highlightTonePriority": "Highlight tone priority",
"activeDLighting": "Active D-Lighting",
"dynamicRangeOptimizer": "D-Range optimizer",
"intelligentDRange": "Intelligent D-Range",
"contrast": "Contrast",
"shutterCount": "Shutter count"
},
"metadata_details_retry": "Could not read metadata. Click to retry.",
"true_north": "True north",
"magnetic_north": "Magnetic north",
"camera_settings": "Camera settings"
"camera_settings": "Camera settings",
"all_brands": "All"
},
"map": {
"show_map": "Show map",
Expand Down
18 changes: 16 additions & 2 deletions src-vite/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,26 @@
"colorChromeFxBlue": "Color Chrome Azul",
"focusMode": "Modo de enfoque",
"driveMode": "Modo de disparo",
"imageStabilization": "Estabilización"
"imageStabilization": "Estabilización",
"pictureStyle": "Estilo de imagen",
"pictureControl": "Control de imagen",
"creativeStyle": "Estilo creativo",
"pictureProfile": "Perfil de imagen",
"pictureEffect": "Efecto de imagen",
"photoStyle": "Estilo de foto",
"autoLightingOptimizer": "Luminosidad automática",
"highlightTonePriority": "Prioridad tonos altas luces",
"activeDLighting": "D-Lighting activo",
"dynamicRangeOptimizer": "Optimizador rango dinámico",
"intelligentDRange": "Rango dinámico inteligente",
"contrast": "Contraste",
"shutterCount": "Disparos"
},
"metadata_details_retry": "No se pudieron leer los metadatos. Haga clic para reintentar.",
"true_north": "Norte verdadero",
"magnetic_north": "Norte magnético",
"camera_settings": "Ajustes de cámara"
"camera_settings": "Ajustes de cámara",
"all_brands": "Todas"
},
"map": {
"show_map": "Ver mapa",
Expand Down
18 changes: 16 additions & 2 deletions src-vite/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,26 @@
"colorChromeFxBlue": "Color Chrome Bleu",
"focusMode": "Mode de mise au point",
"driveMode": "Mode d'entraînement",
"imageStabilization": "Stabilisation"
"imageStabilization": "Stabilisation",
"pictureStyle": "Style d'image",
"pictureControl": "Picture Control",
"creativeStyle": "Style créatif",
"pictureProfile": "Profil d'image",
"pictureEffect": "Effet de photo",
"photoStyle": "Style photo",
"autoLightingOptimizer": "Correction auto de luminosité",
"highlightTonePriority": "Priorité hautes lumières",
"activeDLighting": "D-Lighting actif",
"dynamicRangeOptimizer": "Optimiseur de plage dynamique",
"intelligentDRange": "Plage dynamique intelligente",
"contrast": "Contraste",
"shutterCount": "Nombre de déclenchements"
},
"metadata_details_retry": "Lecture des métadonnées impossible. Cliquez pour réessayer.",
"true_north": "Nord géographique",
"magnetic_north": "Nord magnétique",
"camera_settings": "Réglages de l'appareil"
"camera_settings": "Réglages de l'appareil",
"all_brands": "Toutes"
},
"map": {
"show_map": "Voir carte",
Expand Down
18 changes: 16 additions & 2 deletions src-vite/src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,26 @@
"colorChromeFxBlue": "Color Chrome Kék",
"focusMode": "Fókuszmód",
"driveMode": "Felvételi mód",
"imageStabilization": "Stabilizálás"
"imageStabilization": "Stabilizálás",
"pictureStyle": "Képstílus",
"pictureControl": "Picture Control",
"creativeStyle": "Kreatív stílus",
"pictureProfile": "Képprofil",
"pictureEffect": "Képhatás",
"photoStyle": "Fotóstílus",
"autoLightingOptimizer": "Automatikus megvilágítás-optimalizáló",
"highlightTonePriority": "Csúcsfény-elsőbbség",
"activeDLighting": "Aktív D-Lighting",
"dynamicRangeOptimizer": "D-tartomány optimalizáló",
"intelligentDRange": "Intelligens D-tartomány",
"contrast": "Kontraszt",
"shutterCount": "Expozíciók száma"
},
"metadata_details_retry": "A metaadatok nem olvashatók. Kattintson az újrapróbáláshoz.",
"true_north": "Földrajzi észak",
"magnetic_north": "Mágneses észak",
"camera_settings": "Kamera beállítások"
"camera_settings": "Kamera beállítások",
"all_brands": "Mind"
},
"map": {
"show_map": "Térkép megjelenítése",
Expand Down
18 changes: 16 additions & 2 deletions src-vite/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,26 @@
"colorChromeFxBlue": "Color Chrome Blu",
"focusMode": "Modalità messa a fuoco",
"driveMode": "Modalità scatto",
"imageStabilization": "Stabilizzazione"
"imageStabilization": "Stabilizzazione",
"pictureStyle": "Stile foto",
"pictureControl": "Picture Control",
"creativeStyle": "Stile creativo",
"pictureProfile": "Profilo immagine",
"pictureEffect": "Effetto immagine",
"photoStyle": "Stile fotografico",
"autoLightingOptimizer": "Ottimizzazione luce auto",
"highlightTonePriority": "Priorità tonalità chiare",
"activeDLighting": "D-Lighting attivo",
"dynamicRangeOptimizer": "Ottimizzatore gamma dinamica",
"intelligentDRange": "Gamma dinamica intelligente",
"contrast": "Contrasto",
"shutterCount": "Conteggio scatti"
},
"metadata_details_retry": "Impossibile leggere i metadati. Fai clic per riprovare.",
"true_north": "Nord geografico",
"magnetic_north": "Nord magnetico",
"camera_settings": "Impostazioni fotocamera"
"camera_settings": "Impostazioni fotocamera",
"all_brands": "Tutti"
},
"map": {
"show_map": "Mostra mappa",
Expand Down
Loading