URI path to the image to process
Specific recipe field to extract
Current recipe state for merging and scaling
Optional warning handler for processing issues
Promise resolving to partial recipe object with extracted field
const currentState = {
recipePreparation: [],
recipePersons: 4,
recipeTags: [],
recipeIngredients: []
};
const result = await extractFieldFromImage(
imageUri,
recipeColumnsNames.ingredients,
currentState,
(warning) => console.warn(warning)
);
if (result.recipeIngredients) {
// Ingredients extracted and scaled to current serving size
console.log(`Extracted ${result.recipeIngredients.length} ingredients`);
}
Extracts and processes a specific recipe field from an image
High-level function that combines OCR text recognition with field-specific processing and validation. Handles automatic quantity scaling, state merging, and error reporting.