Comments (2)
Just an afterthought, if you really want to create a file, you can by saving cdvphotolibrary:// to a file:// in your app (directly with JavaScript).
Using cordova-plugin-file, this should look like this:
function saveFile (dirEntry, fileData, fileName) {
dirEntry.getFile(fileName, { create: true, exclusive: false }, function (fileEntry) {
writeFile(fileEntry, fileData);
}, onErrorCreateFile);
}
cordova.plugins.photoLibrary.getPhoto(
libraryItem.id,
function (fullPhotoBlob) {
window.resolveLocalFileSystemURL(cordova.file.dataDirectory, function (dirEntry) {
saveFile(dirEntry, fullPhotoBlob, libraryItem.fileName);
});
},
function (err) {
console.log('Error occured');
});
from cordova-plugin-photo-library.
@hysong15 Thank you :)
I'm sure that in case of thumbnails, you can't resolve "cdvphotolibrary://" files into "file://". The library creates thumbnails on the fly and never creates a file for them.
In case of full image, there was file:// access in the past, which I removed because it only worked on Android, and I want this library to be as cross-platform as possible (to work with iOS also).
Anyway, using cordova-plugin-crop is against the idea of the plugin. The project's aim is to make it possible to use web libraries to work with images on device. So, what we did in our app, we used cropperjs for image cropping, and it worked very well.
from cordova-plugin-photo-library.
Related Issues (20)
- ERROR: Method 'requestAuthorization:' not defined in Plugin 'PhotoLibrary'
- Get photo library on ios 13.2.*+
- Success never shows up when no photos in library
- Complier Error
- undeclared type 'CDVURLProtocol' HOT 2
- how can i save a image with base64
- android 10 support (SDK 29) - get error when saving an image HOT 2
- Dependecy cordova-plugin-add-swift-support version="^2.0.2" is not working. UPDATE for earlier swift versions. HOT 1
- Using “requireCordovaModule” to load non-cordova module “glob” is not supported HOT 4
- Using “requireCordovaModule” to load non-cordova module “glob” is not supported HOT 1
- Getting "open failed: EACCES permission denied" even I have permissions. Android 10 HOT 4
- Can't build in IOS xcode HOT 6
- saveVideo ios 10+ 保存失败? HOT 1
- android 11 support (SDK 30) - get error when saving an image HOT 7
- Way to cancel getLibrary process? HOT 1
- i am not able to access specific album library based of id of album?any you help me
- Issue in Android 11 SDK 30 HOT 2
- img src = cdvphotolibrary://... err_unknown_url_scheme && android sdk > 30
- On Android 12, use the cordova.plugins.photoLibrary.saveImage method to save the image and then the APP will flash back HOT 3
- BSF Cordova Ecosystem Crowdfunding Plan
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-photo-library.