1.0.0 • Published 6 months ago

capcitor-image-cropper v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

🌟 Available Now on Android, with iOS Support Coming Soon! 🌟

🎨 Capacitor Image Cropper

The Capacitor Image Cropper plugin offers a powerful and user-friendly way to crop images in your mobile applications. With this plugin, you can effortlessly select and crop images to meet your desired dimensions, ensuring your app looks polished and professional! ✨

🚀 Features

  • Flexible Cropping Options: Crop images with customizable width, height, and aspect ratios. 📏
  • Quality Control: Adjust the quality of the resulting image, balancing fidelity and file size. 📸
  • Circle Cropping: Optionally crop images in a circular shape for a unique visual flair. 🔵
  • Cross-Platform Support: Works seamlessly on both iOS and Android platforms. 📱
  • uCrop Integration: For Android, we utilize the powerful uCrop library, providing a robust and feature-rich cropping experience. 🎉

📚 Usage

To get started with the Capacitor Image Cropper plugin, simply install it in your project and follow the provided documentation for implementation details.

Transform your images effortlessly with the Capacitor Image Cropper plugin! 🌈

🛠️ Adding JitPack Repository

To add the JitPack repository, navigate to your android/gradle.build file and include the following configuration:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}

📦 Install

Run the following commands to install the plugin:

npm install capacitor-image-cropper
npx cap sync

📖 API

crop(...)

crop(options: CropOptions) => Promise<CropResult>
ParamType
optionsCropOptions

Returns: Promise<CropResult>


Interfaces

CropResult

PropTypeDescription
pathstringThe path to the cropped image On Android: content:// or file:// URI On iOS: file:// URI
base64stringBase64 encoded image data (optional, web only)

CropOptions

PropTypeDescriptionDefault
sourcestringThe path or url of the image to crop Can be a local file path, content:// uri, or file:// uri
qualitynumberQuality of the resulting image, between 0-10090
circlebooleanWhether to crop the image in a circlefalse
widthnumberMaximum width of the resulting image300
heightnumberMaximum height of the resulting image300
aspectRatioXnumberAspect ratio X for crop box (width/height) e.g., 1 for square1
aspectRatioYnumberAspect ratio Y for crop box (height/width) e.g., 1 for square1
activeControlsWidgetColorstringColor of the active controls widget"#9ef500"

👤 Author

Rahul Kumar Sharma

Passionate developer and creator of the Capacitor Image Cropper plugin.

💬 Message

Thank you for using the Capacitor Image Cropper! Your feedback and contributions are always welcome. Let's make image cropping a breeze for everyone! 🌟

🤝 Collaboration

We welcome collaboration! If you have ideas, suggestions, or would like to contribute to the project, feel free to reach out or submit a pull request. Together, we can enhance this plugin and make it even better! 🚀


🎉 Special Thanks

A big shoutout to the uCrop library for providing an excellent cropping experience on Android! Your contributions make this plugin even more powerful! 🙌