{"action":"created","issue":{"url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/394","repository_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview","labels_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/394/labels{/name}","comments_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/394/comments","events_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/394/events","html_url":"https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/394","id":278516895,"number":394,"title":"Height and Width being ignored in Take Picture","user":{"login":"tester12345678910111213","id":21691341,"avatar_url":"https://avatars2.githubusercontent.com/u/21691341?v=4","gravatar_id":"","url":"https://api.github.com/users/tester12345678910111213","html_url":"https://github.com/tester12345678910111213","followers_url":"https://api.github.com/users/tester12345678910111213/followers","following_url":"https://api.github.com/users/tester12345678910111213/following{/other_user}","gists_url":"https://api.github.com/users/tester12345678910111213/gists{/gist_id}","starred_url":"https://api.github.com/users/tester12345678910111213/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tester12345678910111213/subscriptions","organizations_url":"https://api.github.com/users/tester12345678910111213/orgs","repos_url":"https://api.github.com/users/tester12345678910111213/repos","events_url":"https://api.github.com/users/tester12345678910111213/events{/privacy}","received_events_url":"https://api.github.com/users/tester12345678910111213/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-12-01T16:15:27Z","updated_at":"2018-03-09T13:34:24Z","closed_at":null,"author_association":"NONE","body":"I defined the height and width in my application but the plugin is ignoring it and always outputing the same thing. \r\n\r\n`CameraPreview.takePicture({width: 640, height: 640, quality: 85}, (base64Data)=>{\r\n          \r\n          });`"},"comment":{"url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/comments/371813152","html_url":"https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/394#issuecomment-371813152","issue_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/394","id":371813152,"user":{"login":"waitopiggu","id":26673366,"avatar_url":"https://avatars1.githubusercontent.com/u/26673366?v=4","gravatar_id":"","url":"https://api.github.com/users/waitopiggu","html_url":"https://github.com/waitopiggu","followers_url":"https://api.github.com/users/waitopiggu/followers","following_url":"https://api.github.com/users/waitopiggu/following{/other_user}","gists_url":"https://api.github.com/users/waitopiggu/gists{/gist_id}","starred_url":"https://api.github.com/users/waitopiggu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waitopiggu/subscriptions","organizations_url":"https://api.github.com/users/waitopiggu/orgs","repos_url":"https://api.github.com/users/waitopiggu/repos","events_url":"https://api.github.com/users/waitopiggu/events{/privacy}","received_events_url":"https://api.github.com/users/waitopiggu/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T13:34:24Z","updated_at":"2018-03-09T13:34:24Z","author_association":"NONE","body":"I have a 2-line fix, but I don't know if it will cause side-effects.\r\n\r\nAfter 'size' is defined, add another variable to store the initial value over all iterations and use that to check for perfect matches.\r\n\r\n```\r\n...\r\n\r\nif (size.width < size.height) {\r\n  int temp = size.width;\r\n  size.width = size.height;\r\n  size.height = temp;\r\n}\r\n\r\nCamera.Size requestedSize = mCamera.new Size(size.width, size.height);\r\n\r\n...\r\n\r\n// Perfect match\r\nif (supportedSize.equals(requestedSize)) {\r\n  Log.d(TAG, \"CameraPreview optimalPictureSize \" + supportedSize.width + 'x' + supportedSize.height);\r\n  return supportedSize;\r\n}\r\n\r\n...\r\n```"}}
{"actor":{"display_login":"waitopiggu"}}