From 593fdb4826a423cff2bf015effcd8a9ee7eaa198 Mon Sep 17 00:00:00 2001 From: Nedyalko Nikolov Date: Fri, 17 Apr 2015 16:00:17 +0300 Subject: [PATCH 1/2] Api reference added. --- camera/camera.android.ts | 6 +++--- camera/camera.d.ts | 20 +++++++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/camera/camera.android.ts b/camera/camera.android.ts index 72fa8da1b..fc2ec4942 100644 --- a/camera/camera.android.ts +++ b/camera/camera.android.ts @@ -80,9 +80,9 @@ var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeig var createDateTimeStamp = function() { var result = ""; - var date = new Date(); - result = date.getDate().toString() + - (date.getMonth() + 1).toString() + + var date = new Date(2015, 3, 3); + result = (date.getDate() < 10 ? "0" + date.getDate().toString() : date.getDate().toString())+ + ((date.getMonth() + 1) < 10 ? "0" + (date.getMonth() + 1).toString() : (date.getMonth() + 1).toString()) + date.getFullYear().toString() + date.getHours().toString() + date.getMinutes().toString() + diff --git a/camera/camera.d.ts b/camera/camera.d.ts index 0d86af126..0b9132892 100644 --- a/camera/camera.d.ts +++ b/camera/camera.d.ts @@ -7,15 +7,29 @@ declare module "camera" { /** * Take a photo using the camera. - * @param width - Optional parameter which defines the required width of the taken picture. - * @param height - Optional parameter which defines the required height of the taken picture. - * @param keepAspectRatio - Optional parameter which controls if the result picture will keep the aspect ratio of the picture taken by camera. + * @param options - Optional parameter for setting different camera options. */ export function takePicture(options?: CameraOptions): Promise; export interface CameraOptions { + /** + * Defines the desired width (in device independent pixels) of the taken image. It should be used with height property. + * If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image. + * The actual image width will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions). + */ width?: number; + + /** + * Defines the desired height (in device independent pixels) of the taken image. It should be used with width property. + * If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image. + * The actual image height will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions). + */ height?: number; + + /** + * Defines if camera picture aspect ratio should be kept during picture resizing. + * This property could affect width or heigth return values. + */ keepAspectRatio?: boolean; } } From b2e26a4154a6651a080a593a52a04d93af74845d Mon Sep 17 00:00:00 2001 From: Nedyalko Nikolov Date: Fri, 17 Apr 2015 16:29:40 +0300 Subject: [PATCH 2/2] Removed test date. --- camera/camera.android.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/camera.android.ts b/camera/camera.android.ts index fc2ec4942..f8acf8207 100644 --- a/camera/camera.android.ts +++ b/camera/camera.android.ts @@ -80,7 +80,7 @@ var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeig var createDateTimeStamp = function() { var result = ""; - var date = new Date(2015, 3, 3); + var date = new Date(); result = (date.getDate() < 10 ? "0" + date.getDate().toString() : date.getDate().toString())+ ((date.getMonth() + 1) < 10 ? "0" + (date.getMonth() + 1).toString() : (date.getMonth() + 1).toString()) + date.getFullYear().toString() +