cordova-plugin-photos icon indicating copy to clipboard operation
cordova-plugin-photos copied to clipboard

image() return base64 or dataURI

Open victoria168 opened this issue 6 years ago • 4 comments

Hi, I'm using image() function to get panorama photo urls and want to display them in photoviewer. But I only get blob urls which can't be displayed in photoviewer. Are there any ways that I can get base64 or datauri from image()?

I tried eg.4 with File plugin, but the image is too large that I get memory problem.

Currently I'm using FileReader() to read the blob url as base64 then display it. But it's both time and memory consuming.

Anyway, thanks for this great plugin!

victoria168 avatar Nov 29 '17 10:11 victoria168

Base64 is the most memory-consuming case. I'd not recommend to use it for large images. But what a problem do you have with File plugin and writing data wrapped by Blob? Please provide your code snippet and platform you use (including version and device).

domax avatar Nov 30 '17 04:11 domax

I copied from your example 4 under image(), and get the error when executing Photo.image(): Connection to assetsd was interrupted or assetsd died Then the app crashes. I'm running in iphone6 ios10.3.3

victoria168 avatar Dec 01 '17 03:12 victoria168

@victoria168 : I'm trying to reproduce this bug. I just made a panorama photo and successfully fetched it. Do you have any specifics in your image? Which size it has (both - bytes and dimensions)?

domax avatar Dec 04 '17 02:12 domax

The pano is: 13632 * 2936 px. I have around 8 panos loaded.

victoria168 avatar Dec 04 '17 03:12 victoria168