cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Bradshaw <>
Subject Re: Should we change default camera quality?
Date Sun, 26 Jun 2016 20:00:48 GMT

I've recently been working on a rotation fix for the camera plugin for
Android. There are many variables with the camera plugin and you only
described two (quality and destination type). On Android, the reality is a
new bitmap has to be created if a user specifies any of the following:
DATA_URL, quality other than 100, orientation correction, target width,
target height.
We don't have analytics on what users are doing, but I would bet after
looking at code examples for the camera plugin online, most often the
quality is never 100 and FILE_URI only.
Given all these variables, my opinion is to change it to match the docs.

Some time ago I opened this issue to set android default quality to 50 on
the java code (it was really 50 because it was already set on the
javascript part, so the default java value won´t take effect)

But Nikhil commented on the issue and I think what he said makes sense

Should the default be 50? I believe the intent was that it will use lesser
memory and hence, default of 50 is a good thing - but I did some profiling
and setting the quality to anything but 100 on Android actually causes more
memory consumption because the image has to be loaded as a bitmap and
re-compressed. Setting appropriate target height & width along with
FILE_URI is the correct way to reduce the memory requirements. I propose
that the default be changed to 100.

what do you think?

I think setting the default value to 50 to reduce memory only makes sense
in the case that the user uses DATA_URL, but we recommend not to use it

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message