Capture kelvin temperatures in recipes

This commit is contained in:
Sam Becker 2025-03-02 09:43:45 -06:00
parent 82a1c2b103
commit b2d5747cb7
2 changed files with 12 additions and 4 deletions

View File

@ -41,9 +41,12 @@ export default function PhotoRecipe({
exposure?: string
onClose?: () => void
}) {
const whiteBalanceTypeFormatted = whiteBalance.type
.replace(/auto./i, '')
.replaceAll('-', ' ');
const whiteBalanceTypeFormatted =
whiteBalance.type === 'kelvin' && whiteBalance.colorTemperature
? `${whiteBalance.colorTemperature}K`
: whiteBalance.type
.replace(/auto./i, '')
.replaceAll('-', ' ');
const renderRow = (children: ReactNode) =>
<div className="flex gap-2 *:w-full *:grow">{children}</div>;

View File

@ -5,6 +5,7 @@ const TAG_ID_DYNAMIC_RANGE_SETTING = 0x1402;
const TAG_ID_DEVELOPMENT_DYNAMIC_RANGE = 0x1403;
const TAG_ID_WHITE_BALANCE = 0x1002;
const TAG_ID_WHITE_BALANCE_FINE_TUNE = 0x100a;
const TAG_ID_WHITE_BALANCE_COLOR_TEMPERATURE = 0x1005;
const TAG_ID_NOISE_REDUCTION = 0x100e;
const TAG_ID_NOISE_REDUCTION_BASIC = 0x100b;
const TAG_ID_HIGHLIGHT = 0x1041;
@ -29,7 +30,8 @@ export type FujifilmRecipe = {
development: number
}
whiteBalance: {
type: string
type: ReturnType<typeof processWhiteBalanceType>
colorTemperature?: number
red: number
blue: number
}
@ -210,6 +212,9 @@ export const getFujifilmRecipeFromMakerNote = (
recipe.whiteBalance.red = processWhiteBalanceComponent(numbers[0]);
recipe.whiteBalance.blue = processWhiteBalanceComponent(numbers[1]);
break;
case TAG_ID_WHITE_BALANCE_COLOR_TEMPERATURE:
recipe.whiteBalance.colorTemperature = numbers[0];
break;
case TAG_ID_NOISE_REDUCTION:
recipe.highISONoiseReduction = processNoiseReduction(numbers[0]);
break;