[Camera Plugin] Camera Pugin Resolution
Question
Forge component by OutSystems R&D

Hi Guys,


Is there a way that I can increase the resolution of the pictures that are taken with the Camera Plugin?

Average size is between 30 and 60 kb , but I need the pictures to be much more clear.


Thank you in advance!

Solution

Hey, Stefan,

I had a look at the plugin and it looks like we have the settings hardcoded to 60% quality and JPEG format.

However, you can clone the plugin and change those settings to increase quality, namely on the 'TakePictureJS' node, on the 'Take Picture' action. Have a look at this section from our GitHub repository, for reference on what's possible to do.

Can you try changing the setting to 100 and tell us how it went?

Best regards,

Carlos Simões

Hi Carlos,

Thank you for pointing me into the right direction. In my situation the bottleneck was the targetHeight/ width. This is set to 600 in the same TakePictureJS-node. When I increase it to for example 2000 the size of the image increases also. 

Solved! 


Best regards,

Stefan Dirkx

Great stuff! Glad to know I helped!

I'll also pass on the feedback about these more complex settings.

Best regards,

Carlos Simões

i had this requirement also, it would be nice to be able to control the resolution/ size of the image

Hi Linguo,


You can change the resolution by changing the targetHeight/ width in the TakePictureJS-node of the plugin. If you want to have a different resolution on different places in your apps, then you can add an inputparamter to the take picture action which you pass on to the TakePictureJS-node.


Good luck!


just found out that i am using the default upload widget... any idea how to change the default setting?

mvp_badge
MVP

Thanks Stephan! This parameters should be part of the original plugin.

Hi guys! I just want you to know that we've listened to your feedback and we've addressed some limitations of the Camera Plugin. So starting from V7.0.1 of this plugin (now booked as under development on Forge), you can define the Quality, Width, Height, and Encoding Type (JPEG, PNG) of your photos just by selecting/defining the properties of the TakePicture action.
In addition, we've created two new blocks that should appear on the widget's panel after you install the new version of the plugin. These blocks hugely accelerate the implementation of "Take Picture" or "Choose from Gallery" actions. Likewise, you can define the properties of these blocks to choose the image quality parameters that suit you better.

Have a look at the new documentation page of the Camera plugin for more information on these new features.

Please, try out this version by going on the versions tab of Forge and downloading V7.0.1, and let us know what you think. We should be passing this version to stable in a couple of weeks. 

Hi,

I'm a bit confused about the width/height parameters of the TakePicture action.
No matter what value is used for these settings; the picture size is always more than 4Mb for me.
When providing width/height of 640x480, I expect the output binary to be much smaller, but it still is > 4Mb
Is there something I'm doing wrong?

Hi Rob,

From your description of the problem, it seems to me that you are encountering one of the quirks reported on the Camera documentation (see the last entry on the Known issues section). According to the documentation, when you change the resolution or quality setting, the plugin applies it only to the image that the app uses. The device ignores the settings when saving the images in the device gallery. This means that the size of the image in the gallery depends on the device hardware but the picture displayed on the app depends on the parameters you've defined on the plugin.

You can test this by taking a picture with a given definition and then press/hold that picture as displayed in the app and storing that app picture on your device. Try this with two different configurations and you'll find out that for the app picture the file size will vary according to the resolution and quality parameters.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.