Supported since v0.7.0
Resulting images can be extracted into the file system with onExtractImage
prop. It returns path to a temporary file inside cache folder that contains filtering result and triggers when
extractImageEnabled
changes to true
. While extractImageEnabled
remains truthy onExtractImage
will trigger every time filtering result changes.
To delete all temporary files created this way you need to call
cleanExtractedImagesCache function. Since
these files are saved to cache folder they can be removed by user or system at any time. Usage example.
<Grayscale
style={styles.image}
onFilteringError={
({ nativeEvent }) => dispatch(['show-error', new Error(nativeEvent.message)])
}
onExtractImage={({ nativeEvent }) => dispatch(['save-photo', nativeEvent.uri])}
extractImageEnabled={true}
image={
<Image
style={styles.image}
source={{ uri: state[1] }}
/>
}
/>