capawesome-team / capacitor-plugins

⚡️ Community plugins for Capacitor. Supports Android, iOS and the Web.
https://capawesome.io/plugins/
233 stars 37 forks source link

feat: Options for resizing and changing image quality when using FilePicker #298

Closed webfletch closed 3 weeks ago

webfletch commented 3 weeks ago

Plugin(s)

Current problem

Need the ability to resize and reduce the quality of images selected from the image library.

Images taken on phone camera's are usually very high resolution and therefore very large to store or upload.

Preferred solution

The official Capacitor Camera plugin allows you to pass through parameters to resize and reduce the quality of the images returned, so something similar to that would be great:

const options: PickImageOptions = {
   quality: 0.8,
   maxWidth: 400,
   maxHeight: 200
 };

const images = await FilePicker.pickImages(options);

Alternative options

No response

Additional context

No response

Before submitting

robingenz commented 3 weeks ago

That's what the File Compressor plugin is for. Changing the image quality is already possible. For resizing, there is already a feature request: https://github.com/capawesome-team/capacitor-plugins/issues/128 I close this issue as duplicate.