# Capture a processed photo in React Native

> Capture the current processed preview to a temporary JPEG and optionally copy it to the media library.

> For AI agents: the complete documentation index is at https://nosmai.com/llms/effects.txt

Product: Nosmai Effects
Group: guide
Source: https://nosmai.com/docs/effects/guides/output/capture-a-photo/react-native/

## Prerequisites

- A working [React Native quickstart](/docs/effects/quickstart/react-native/)
- A ready `NosmaiCameraView`

## Capture the processed frame

```tsx
const photo = await NosmaiCameraSdk.capturePhoto();

console.log(photo.uri, photo.width, photo.height);
```

The result is a temporary local JPEG with `uri`, `width`, `height`,
`fileSizeBytes`, and `mimeType`.

## Save it to the gallery

```tsx
const saved = await NosmaiCameraSdk.saveImageToGallery(
  photo.uri,
  'nosmai-photo'
);
```

Only pass a local `file://` URI returned by the SDK. The method rejects remote
URLs and malformed paths.

## Verify it worked

Apply a visible effect, capture once, and confirm that the JPEG exists and the
saved media URI is returned.

## Common errors

| Symptom | Cause | Fix |
| --- | --- | --- |
| Capture rejects before returning a URI | The native camera view is not ready | Wait for the processed preview before calling `capturePhoto` |
| Gallery save fails | Media-library permission is missing or denied | Request the platform permission before saving the returned file |

## Next steps

- [Record processed video in React Native](/docs/effects/guides/output/record-video/react-native/)
- [Add an AR mask in React Native](/docs/effects/guides/effects/add-an-ar-mask/react-native/)

## References

- [React Native platform guide](/docs/effects/platforms/react-native/)
- [Troubleshooting](/docs/effects/troubleshooting/)
