Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7526399CC for ; Fri, 15 Jun 2012 21:32:41 +0000 (UTC) Received: (qmail 52067 invoked by uid 500); 15 Jun 2012 21:32:41 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 52039 invoked by uid 500); 15 Jun 2012 21:32:41 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 52024 invoked by uid 99); 15 Jun 2012 21:32:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2012 21:32:41 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fil@adobe.com designates 64.18.1.189 as permitted sender) Received: from [64.18.1.189] (HELO exprod6og105.obsmtp.com) (64.18.1.189) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2012 21:32:34 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob105.postini.com ([64.18.5.12]) with SMTP ID DSNKT9up3Vlmg1lFcobfCEdqG56+JP+aUL3x@postini.com; Fri, 15 Jun 2012 14:32:13 PDT Received: from inner-relay-1.corp.adobe.com (inner-relay-1.sea.adobe.com [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q5FLWBX9007924 for ; Fri, 15 Jun 2012 14:32:12 -0700 (PDT) Received: from nahub02.corp.adobe.com (nahub02.corp.adobe.com [10.8.189.98]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q5FLWBvm029565 for ; Fri, 15 Jun 2012 14:32:11 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nahub02.corp.adobe.com ([10.8.189.98]) with mapi; Fri, 15 Jun 2012 14:32:11 -0700 From: Filip Maj To: "callback-dev@incubator.apache.org" Date: Fri, 15 Jun 2012 14:33:04 -0700 Subject: Re: Android Camera Woes Thread-Topic: Android Camera Woes Thread-Index: Ac1LPlIqarmQRfWKR0GkRY0GipfEMA== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.2.120421 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org I have a few suggestions, but maybe not all of them would impact the problems you describe below: - get rid of DATA_URL. Canvas provides a built-in alternative to getting this data if necessary. - get rid of any resizing. Users should be able to do this by dropping the picture file URI into an image tag and resizing the image tag as necessary. - possibly consider eliminating quality as well. On 6/15/12 1:21 PM, "Simon MacDonald" wrote: >Hey all, > >I've been looking into our Camera woes for the past couple of days. >Regardless of the options we load the image into an Android Bitmap >object. For a 5 MP camera at 2048x1536 the resulting size of the image >in memory is 12 MB. So it is no wonder we get issues like >https://issues.apache.org/jira/browse/CB-910. > >I noticed one thing we are doing wrong that I'm going to correct. In >the use case where we ask for a FILE_URI with default quality, default >width and default height we still load the image into memory. I know a >way we can get around doing this and will implement it early next >week. Although this only improves one use case. > >In the case where the user asks for a new height or width the image >has to be loaded into a bitmap in order to be scaled and a second >bitmap is created to hold the scaled image. This can be improved if we >remove the ability for the user to specify width/height and replace >that with a scale factor. We can remove the need to load the full >image in memory and only load the scaled image in memory if we only >allow it to be halved, quartered, etc. This will result in a lot less >memory being used. > >The third issue is the quality parameter. It is fairly useless. Asking >for the quality to be 80% still requires the entire image to be loaded >in memory before it is processed. The resulting file size is not 20% >smaller than the original and the actual picture "quality" looks >horrible. I do no like this parameter and we should discourage people >from using it. > >Anyway, that the state of the onion right now. If anyone knows of some >way to edit the image file in place without having to load it in an >expensive (memory wise) Bitmap object I'm all ears. > >Thanks... > >Simon Mac Donald >http://hi.im/simonmacdonald