Code Monkey home page Code Monkey logo

capawesome-team / capacitor-cloudinary Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 557 KB

⚡️ Unofficial Capacitor plugin for integrating with Cloudinary.

Home Page: https://capawesome.io/plugins/cloudinary/

License: MIT License

Ruby 3.15% Java 38.29% Swift 23.27% Objective-C 2.42% JavaScript 1.40% TypeScript 31.49%
android capacitor capacitor-android capacitor-community capacitor-ios capacitor-plugin capacitor-web capacitorjs capawesome cloudinary ios web

capacitor-cloudinary's People

Contributors

dependabot[bot] avatar robingenz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

capacitor-cloudinary's Issues

bug: ios does not apply ResourceType

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.

image

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! 👌

feat: upload a blob from ios/android

I understand the main use case of this plugin to be:

  • upload directly from a 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.

feat: get height/width included in UploadResult as per cloudinary's documentation

Is your feature request related to a problem? Please describe:

the problem:

  • I'm trying to calculate the height/width of a .heic file like the one attached below. However, loading this in an <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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.