capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

Prevent Saving Original Full-Size Image When saveToGallery Is Enabled

Open inventor7 opened this issue 4 months ago • 0 comments

Bug Report

Plugin(s)

@capacitor/camera (please include version you are using, e.g. @capacitor/[email protected])

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

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.

inventor7 avatar Sep 07 '25 09:09 inventor7