Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 538BC200C3D for ; Tue, 28 Feb 2017 04:36:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 523FC160B60; Tue, 28 Feb 2017 03:36:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9D955160B6C for ; Tue, 28 Feb 2017 04:36:50 +0100 (CET) Received: (qmail 18794 invoked by uid 500); 28 Feb 2017 03:36:49 -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 18783 invoked by uid 99); 28 Feb 2017 03:36:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2017 03:36:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 40F1B1A070F for ; Tue, 28 Feb 2017 03:36:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.347 X-Spam-Level: X-Spam-Status: No, score=-2.347 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-2.999, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id njJMthP7Mh1R for ; Tue, 28 Feb 2017 03:36:48 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D199C61F00 for ; Tue, 28 Feb 2017 03:36:47 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B075FE0A6C for ; Tue, 28 Feb 2017 03:36:46 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id CA5A124154 for ; Tue, 28 Feb 2017 03:36:45 +0000 (UTC) Date: Tue, 28 Feb 2017 03:36:45 +0000 (UTC) From: "Shazron Abdullah (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-12512) No way to get from a FILE_URL to a DATA_URL onsuccess MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 28 Feb 2017 03:36:51 -0000 [ https://issues.apache.org/jira/browse/CB-12512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shazron Abdullah updated CB-12512: ---------------------------------- Component/s: (was: Android) (was: iOS) Plugin File Plugin Camera > No way to get from a FILE_URL to a DATA_URL onsuccess > ----------------------------------------------------- > > Key: CB-12512 > URL: https://issues.apache.org/jira/browse/CB-12512 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Camera, Plugin File > Environment: Android 4.0+ / iOS 9.0+ > Reporter: Kyle Slack > > The onsuccess function of the getPicture method uses the FILE_URI to set an source perfectly fine, however, the conversion of this FILE_URI to get the image data or DATA_URL is never successful no matter the means attempted. Even utilizing your posted methods to get the actual file have failed: > window.resolveLocalFileSystemURL(imgUri, function success(fileEntry) - is not getting to the image, always results in null DATA_URL in the end. > Our method using FILE_URI: > {code} > navigator.camera.getPicture(function (data) { > setTimeout(function () { > StatusBar.overlaysWebView(true); > setTimeout(function () { > StatusBar.overlaysWebView(false); > }, 250); > }, 250); > viewModel.txtImageStatus("Loading..."); > document.getElementById("image").src = data; > viewModel.showNoImage(false); > document.getElementById("image").style.display = "block"; > SavetoShipment(data); > }, function (msg) { > if (!msg == "Camera cancelled.") { > viewModel.popVisible(true); > viewModel.popMessage("Failed: " + msg); > }; > setTimeout(function () { > StatusBar.overlaysWebView(true); > setTimeout(function () { > StatusBar.overlaysWebView(false); > }, 250); > }, 250); > }, { > quality: DevExpress.devices.real().platform == "ios" ? 50 : 100, > destinationType: Camera.DestinationType.FILE_URI, > saveToPhotoAlbum: false, > correctOrientation: true, > encodingType: DevExpress.devices.real().platform == "ios" ? Camera.EncodingType.PNG : Camera.EncodingType.JPEG > }); > function SavetoShipment(fileURI) { > var fileReader = new FileReader(); > fileReader.onload = function (fileLoad) { > viewModel.shipment.CustomerPhotoInfo = fileLoad.target.result; > }; > fileReader.readAsDataURL(fileURI); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org