capawesome-team / capacitor-cloudinary Goto Github PK
View Code? Open in Web Editor NEW⚡️ Unofficial Capacitor plugin for integrating with Cloudinary.
Home Page: https://capawesome.io/plugins/cloudinary/
License: MIT License
⚡️ Unofficial Capacitor plugin for integrating with Cloudinary.
Home Page: https://capawesome.io/plugins/cloudinary/
License: MIT License
Plugin version:
0.1.0
Platform(s):
ios
Current behavior:
ios can only upload images - uploading other resource types results in 400 error message Invalid Image File.
Expected behavior:
Resource type should on ios should allow resource to be uploaded
Steps to reproduce:
For example, set ResourceType to ResourceType.Video
, select a video (ie with @capawesome/file-picker), call the uploadResource method and observe the error.
Since resource type doesn't get implemented correctly in ios the upload defaults to "image" and so any other file type fails.
Related code:
I believe this is due to a small omission in the swift code - The resource type is passed in but never implemented. I added a line that sets the resource type in Cloudinary.swift
(commented out in screenshot to highlight the missing line) and with that i can get the ios implementation to work.
Other information:
I'm in the middle of a deadline - but hopefully can PR this small fix shortly!
In the meantime, just wanted to bring it to your attention in case anyone else runs into this.
Capacitor doctor:
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 4.6.1
@capacitor/core: 4.6.1
@capacitor/android: 4.6.1
@capacitor/ios: 4.6.1
Installed Dependencies:
@capacitor/cli: 4.4.0
@capacitor/core: 4.4.0
@capacitor/android: 4.4.0
@capacitor/ios: 4.4.0
[success] iOS looking great! 👌
[success] Android looking great! 👌
I understand the main use case of this plugin to be:
path
when on ios/android. This will prevent some memory issues related to webview.However, in some cases an app might still have some minor cases where they already have a blob and want to pass that (eg. an image created/edited on a canvas in the DOM; another example would be to have a client draw a signature on a canvas via a touch screen and save that in cloudinary).
So it will be helpful if we can still pass a blob even on ios and android, even though I understand this is not the main use case.
The docs could say something like this:
-- | -- | -- |
---|---|---|
blob | Blob | The file to upload. For usage on the web. Also available on Android and iOS, but not recommended. Use path on Android and iOS to prevent memory issues when working with large files. |
seems cloudinary also returns duration which is a value that is valuable to me : )
can you add this to the UploadResponse?
PS: I believe it's in seconds, which is good because it's the same as the Video element
Is your feature request related to a problem? Please describe:
the problem:
<img />
element directly to be able to grab the height/width does not work. It throws an error on load { isTrusted: true }
with no other error message.Describe the solution you'd like:
the solution:
However, this library is not including the height/width in the upload response.
Can you include the height/width in the upload response? Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.