incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon MacDonald <>
Subject Re: Android Camera changes
Date Wed, 27 Jun 2012 20:38:18 GMT
Yeah, it seemed redundant to me as well but once I read it existed I
thought I should use it for consistencies sake.

Simon Mac Donald

On Wed, Jun 27, 2012 at 4:34 PM, Filip Maj <> wrote:
> I was actually looking at the docs for that..
> Wtf why even have an option like that? Is there a use case where you DONĀ¹T
> want that?
> On 6/27/12 1:28 PM, "Simon MacDonald" <> wrote:
>>Did you get latest code with the commit:
>>"Wire rotation fix to correctOrientation parameter"
>>If you did you'll have to set correctOrientation to true in the
>>options you pass to the getPicture method.
>>Simon Mac Donald
>>On Wed, Jun 27, 2012 at 4:26 PM, Filip Maj <> wrote:
>>> Just cloned down and tested the various options.
>>> Works on a Galaxy Nexus running 4.0.4.
>>> On a Nexus S running 2.3.6, all pictures taken are rotated 90 degrees..
>>> But I'm not sure if this was always the case or not..
>>> On 6/27/12 11:24 AM, "Simon MacDonald" <>
>>>>Hey all,
>>>>I've been spending a lot of time in the Camera code recently trying to
>>>>improve it in a number of ways. First off the way we were loading the
>>>>entire image into a Bitmap (stored in memory) was causing some
>>>>problems. For instance on my Samsung Galaxy Note a picture takes up 30
>>>>mb of memory when loaded into a Bitmap. This was causing out of memory
>>>>errors in apps that use the camera.
>>>>I've gone through the code and made a number of improvements.
>>>>1) If the call to get picture does not require a width, height or
>>>>quality change we no longer load the image into a Bitmap as it is
>>>>unnecessary. Saves a ton of memory.
>>>>2) If the call to get picture requires a width and height change we no
>>>>longer load the entire image into a Bitmap. First we take advantage of
>>>>the input sample size to load a smaller version of the image which is
>>>>closer to the width and height of the one requested by the user. For
>>>>instance if users calls get picture asking for a 900 x 900 image we
>>>>load the image into memory using a sample size of 2 which gives us a
>>>>1000 x 1000 image that is resized to 900 x 900. This saves a bunch of
>>>>unnecessary memory usage as well as a 2000x2000 image is 15.6 mb while
>>>>a 1000x1000 image is only 3.9 mb so the benefit on memory usage is
>>>>3) I fixed an issue on Samsung devices where a picture is still stored
>>>>in the Gallery even if you set saveToPhotoAlbum to false.
>>>>4) I fixed the long standing issue where a picture taken in portrait
>>>>mode ends up being displayed on it's side in the webview. This is
>>>>because the web view just doesn't care about exif orientation
>>>>information. Now I rotate all images to the normal orientation. Images
>>>>display correctly in the webview, Gallery and on the desktop.
>>>>So I really would like to check this in before 1.9.0 is release but
>>>>I'd love if someone could look over the code just to make sure my
>>>>changes are sane.
>>>>Simon Mac Donald

View raw message