Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16690] iOS: Add ability to provide the size parameters to TiMedia Camera API so the image could be sized natively

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionDone
Resolution Date2016-12-27T13:43:52.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
LabelsAPP-751978, supportTeam
ReporterEduardo Gomez
AssigneeEric Merriman
Created2014-03-25T03:13:46.000+0000
Updated2017-03-24T18:51:51.000+0000

Description

Feature Request

Right now, Ti developer is forced to transform and size the (very large) image blob in JS. Any bit of memory can be saved when using the Camera API would lead to a reduction of the frequency of memory-related crashes / kills by the iOS. Please see the _stackoverflow_ link: http://stackoverflow.com/questions/19027869/ios-app-crashes-when-taking-a-photo (the code to do the transform in a background thread).

Comments

  1. Travis Crist 2014-04-25

    Clarification for this request as requested by Dan.

    New Feature - Resize the Image when its returned from the Titanium Camera Object:

    In the answer to the stack overflow question they mention using the imagePickerController:didFinishPickingMediaWithInfo to resize the image appropriately when it is returned from the camera. We would like to be able to pass in a height and width to the Titanium Camera object and have the Titanium Camera logic resize the image with the imagePickerController:didFinishPickingMediaWithInfo on a background thread. When performing this resize the image data should not be stored to the disk. The idea is to perform this in native iOS instead of resizing it in javascript as our team does now which should save some memory and improve the stability of the Titanium Camera Object on iOS.

    Acceptance:

    1. The Titanium Camera Object can be passed a height and/or width property. 2. Before the Titanium Camera Object passes the taken image back to the application it uses the imagePickerController:didFinishPickingMediaWithInfo method to resize the image to the passed in width and/or height properties in a background thread. 3. If only a width or height is passed in the other is automatically calculated, it might actually need to be designed to only support a height or width since the aspect ratio needs to be preserved. 4. The images aspect ratio is preserved. 5. The image is never written to the iOS devices disk.
  2. Hans Knöchel 2016-12-27

    Resolving this issue, since the functionality Vishal suggested does work great
  3. Lee Morris 2017-03-24

    Closing ticket with reference to the above comment from Hans.

JSON Source