Fix native OOM crash caused by ImageManipulator failure falling back to massive raw sensor capture
This commit is contained in:
@@ -185,7 +185,15 @@ export default function PreviewScreen({
|
||||
|
||||
// ── Capture the final image ──
|
||||
const captureComposite = async () => {
|
||||
return currentPhoto;
|
||||
try {
|
||||
if (viewShotRef.current) {
|
||||
return await viewShotRef.current.capture();
|
||||
}
|
||||
return currentPhoto;
|
||||
} catch (e) {
|
||||
console.error('Failed to capture composite:', e);
|
||||
return currentPhoto;
|
||||
}
|
||||
};
|
||||
|
||||
// Triggers the view capture and the print job
|
||||
@@ -356,7 +364,9 @@ export default function PreviewScreen({
|
||||
activeOpacity={1}
|
||||
onPress={handleCanvasPress}
|
||||
>
|
||||
<View
|
||||
<ViewShot
|
||||
ref={viewShotRef}
|
||||
options={{ format: 'jpg', quality: 0.95 }}
|
||||
style={styles.viewShotContainer}
|
||||
>
|
||||
{renderCollageView()}
|
||||
@@ -384,7 +394,7 @@ export default function PreviewScreen({
|
||||
onUpdate={handleStickerUpdate}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
</ViewShot>
|
||||
|
||||
{/* Sticker Tray (outside ViewShot — not captured) */}
|
||||
{showStickerTray && (
|
||||
|
||||
Reference in New Issue
Block a user