Giter Site home page Giter Site logo

cropmaster's Introduction

uCrop'n'Edit - Image Cropping and Editing Library for Android

This repository is a fork of uCrop'n'Edit, which is in turn a fork of uCrop. I fixed some bugs, updated the dependencies and gradle, and converted much of the code to Kotlin. Furthermore, I added the option to use an ActivityResultLauncher instead of onActivityResult which is deprecated. In addition, in the changelogs you can see all other features I added.

Features

uCrop'n'Edit extends uCrop by adding the ability to change Brightness, Contrast, Saturation, and Sharpness of images. I added a few more things. You can see these in the changelog.

Usage

  1. Include the library as a local library project in your build.gradle:

    allprojects {
    	repositories {
    		...
    		maven { url 'https://jitpack.io' }
    	}
    }
    
    ...
    
    dependencies {
            implementation 'com.github.jens-muenker:uCrop-n-Edit:3.0.6'
    }
    
  2. Add UCropActivity into your AndroidManifest.xml

    <activity
        android:name="com.yalantis.ucrop.UCropActivity"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
    

ActivityResultLauncher

  1. Create an ActivityResultLauncher and handle uCrop result.

    private val activityResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
        if (result.resultCode == Activity.RESULT_OK) {
            val imageUri: Uri = UCrop.getOutput(result.data!!)!!
        }
    }
  2. The uCrop configuration is created using the builder pattern.

    UCrop.of(sourceUri, destinationUri)
        .withAspectRatio(16, 9)
        .withMaxResultSize(maxWidth, maxHeight)
        .start(context, activityResultLauncher)

Here you can find possible options.

Feedback and Contributions

If you have any ideas for uCrop'n'Edit, feel free to let me know. I will try my best to keep this up to date. If you find any bugs, please add a new issue.

Changelog

3.0.6

  • removed onActivityResult (jens-muenker#6)
  • updated dependencies and gradle (jens-muenker#3)
  • set sourceCompatibility and targetCompatibility to java version 21

3.0.5

  • added support for destination uri as a content provider uri (Yalantis#886)
  • updated dependencies and gradle

3.0.4

  • updated dependencies
  • added Vietnamese localization (Yalantis#845)
  • updated French localization (Yalantis#838)
  • updated Italian localization (Yalantis#878)
  • updated German localization

3.0.3

  • transleted sample to kotlin
  • added option to set titlebar text gravity and size (Yalantis#856)

3.0.2

  • downgraded gradle to 7.4 (Because jitpack.io does not support higher versions at the moment)

3.0.1

  • updated to newest gradle version
  • added option to pass an extra-bundle to the intent. This will be passed back after the cropping.

3.0.0 - Based on uCrop'n'Edit 2.2.8 and uCrop 2.2.8:

  • updated to newest gradle version
  • updated libarys to newest versions
  • added an AcivityResultLauncher for UCrop
  • fixed a bug mentioned in the uCrop pull requests (Yalantis#809)

License

This software is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Copyright 2023, Jens Münker

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

For uCrop:

Copyright 2017, Yalantis

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

cropmaster's People

Contributors

jens-muenker avatar shliama avatar krokyze avatar p1nkydev avatar legementarion avatar dwikyhardi avatar oleksandnekrasov avatar ukevgen avatar larin92 avatar cool04ek avatar lithiumsheep avatar penzk avatar simonpercic avatar hearsilent avatar severianremi avatar dmytro1morozov avatar edbaev avatar voltazor avatar warko-san avatar bechau avatar teerawk avatar rwliang avatar peterhav avatar kucherenkoihor avatar beigirad avatar timkoers avatar start141 avatar isamborskiy avatar vanniktech avatar luisvasquez avatar

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.