From issues-return-98776-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Sat May 2 23:31:55 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8269118064A for ; Sun, 3 May 2020 01:31:55 +0200 (CEST) Received: (qmail 20554 invoked by uid 500); 2 May 2020 23:31:55 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 20542 invoked by uid 99); 2 May 2020 23:31:54 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2020 23:31:54 +0000 From: =?utf-8?q?GitBox?= To: issues@cordova.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bcordova-plugin-camera=5D_vratislavino_opened_a_new?= =?utf-8?q?_issue_=23590=3A_getPicture=28=29_fails_with_Ionic_?= Message-ID: Date: Sat, 02 May 2020 23:31:54 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit vratislavino opened a new issue #590: URL: https://github.com/apache/cordova-plugin-camera/issues/590 # Bug Report ## Problem ### What is expected to happen? I expected camera plugin to return BASE64 data so I can send it and save it on server. ### What does actually happen? On device, this.camera.getPicture(options) fails with error message: > Cannot read property 'present' of undefined Same thing happens if I use CAMERA or PHOTOLIBRARY as sourceType ### Command or Code imported `import { Camera } from '@ionic-native/camera/ngx';` injected in constructor `constructor(public camera: Camera) { }` and then used in my upload() method ``` let options = { quality: 100, destinationType: this.camera.DestinationType.DATA_URL, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, sourceType: this.camera.PictureSourceType.CAMERA, saveToPhotoAlbum: false, correctOrientation: false }; this.camera.getPicture(options).then((imageData) => { let base64Image = 'data:image/jpeg;base64,' + imageData; this.sendToServer(base64Image); }).catch(err => { console.log(err.message); }); ``` ### Environment, Platform, Device Not depending on device, happened on multiple devices wit different versions, eg. Xiaomi Mi 8 - Android 10 Samsung Galaxy A3 - Android 6 ### Version information Ionic 5.4.16 Cordova: 9.0.0 (cordova-lib@9.0.1) cordova-plugin-camera 4.1.0 "Camera" ## Checklist - [x] I searched for existing GitHub issues - [x] I updated all Cordova tooling to most recent version - [x] I included all the necessary information above ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org