Resolution for photos uploaded via capture-file

We have the app, where users could add attachments to their reports. It uses a component capture-file to add it, since any format can be loaded (pdf or photos/images). However, when you save photos, they are saved in full resolution and weigh quite a lot.

There is a resolution parameter for capture-photo component that is responsible for the quality of the photo. Is there something similar for a capture-file component?

If it cannot be done by setting any parameter for component, could you please suggest another way to compress the images that are obtained when using the component?

Thanks!

@khilda Unfortunately we cannot compress files when uploading files using the <capture-file /> component.

Similarly, we also cannot compress photos when users upload photos to a <capture-photo /> component, as opposed to capturing a new photo using the camera directly from the component.

Basically this is because there is no reliable way to “remove data” from an image or a file after the fact.

The only way to enforce a specific resolution (and file size I guess) is to force users to capture new photos and not allow them to upload from the gallery.

So if you know they are only going to upload PDFs or capture photos, then you can allow them to upload PDFs (but only PDFs) using the <capture-file /> component, and force them to capture photos using the <capture-photo /> component

1 Like