ionic-team / ionic-team/capacitor-camera

Prevent Saving Original Full-Size Image When saveToGallery Is Enabled

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
1
Avg merge
2d 1h
Merged PRs (30d)
2

Description

## Bug Report

### Plugin(s)

`@capacitor/camera` (please include version you are using, e.g. `@capacitor/camera@6.0.0`)

### Capacitor Version

```
"@capacitor/camera": "^6.0.2"
```

### Platform(s)

* Android

### Current Behavior

When using `Camera.getPhoto()` with the `saveToGallery` option set to `true`, the app performs two actions:

1. Saves the compressed picture to the device gallery (✅ expected).
2. **Also saves the original, full-sized picture inside the app's internal storage** (❌ unexpected).

This leads to very large storage usage over time because the original images are kept unnecessarily in the app folder.

### Expected Behavior

When `saveToGallery: true` is used, only the compressed photo should be saved to the gallery.
The original full-size image should **not** be saved in the app's internal storage, or there should be a parameter to explicitly disable this behavior.

### Code Reproduction

```ts
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';

const photo = await Camera.getPhoto({
quality: 70,
resultType: CameraResultType.Uri,
source: CameraSource.Camera,
saveToGallery: true, // Causes original full-size image to also be stored in app's folder
});
```

### Other Technical Details

* Capacitor CLI version: (paste from `npx cap doctor`)
* Android device(s) tested: (list device + Android version)
* Development environment: (IDE version, Node.js version, etc.)

### Additional Context

This behavior results in large app storage usage over time.
Feature request: Add a parameter like `skipAppStorage: true` (or similar) to prevent saving the original photo in app storage when `saveToGallery` is enabled, or change the default behavior to only store the compressed photo.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.