![]() Override the onActivityResult method and handle it with uCrop. The uCrop configuration is created using the builder pattern. Include the uCrop library as a local project library. While the library itself requires a minimum of API level 10, the sample works with API level 15+. UCrop has a builder-type interface for initialization and for setting a proper configuration in your app. out-of-the-box Activity with functional design, neat widgets for more precise image rotation and scaling, and a set of pre-defined common aspect ratios (1:1, 4:3, 3:4, 2:3, 3:2, 16:9, 9:16 + aspect ratio of the original image).supporting touch gestures: scroll (pan) image with one finger, rotate image with two fingers, pinch to zoom, double tap to zoom.UCrop is an Android library that allows you to clip images for further use. uCrop: A Library That Solves Image Cropping Problems I hope Scissors gets more useful features in the following versions.Īfter analysing the drawbacks of the existing libraries, we decided to create our own library with gesture support and a neat UX. Scissors, though, has integrations with popular image libraries such as Picasso, Glide, and Universal Image Loader. But in fact, we again have another library that cannot rotate images and change aspect ratio dynamically. None of them fulfilled the requirements we needed so we decided to build our own.”Ī praiseworthy approach, indeed. Here is a quote from the blog post about Scissors: But my excitement dissipated within 5 minutes. Scissors is a new library, and I was so excited to see it recently in an Android Weekly issue. ![]() It also has guidelines and a method for rotating images (only a method, however, so you need to figure out a gesture detection or some sort of a spinner to control the gestures on your own). However, this library supports dynamically changing the crop frame aspect ratio. But there are lots of other more interesting shapes for profile pictures that you won’t be able to implement using this library.Įdmodo Cropper is quite similar to the SoundCloud library, and has some of the same drawbacks. Of course, if you just need to get a square image for a profile photo you can do it without any problems. Last but not least, aspect ratio cannot be changed using the SoundCloud library. Furthermore, there are millions of users who want to be able to rotate images (and not only by 90°). Come on, guys! Everyone knows that there are hundreds of “magic” Android phones that put wrong EXIF information inside photos (thankfully, we have CWAC to clear this mess up). I was sure Instagram taught us some good UX lessons, and the movable crop frames have died out.Īlso, the SoundCloud cropping library doesn’t allow us to do any rotations. This causes some pain when you need to crop a small area of an image, and it feels wrong from the user experience point of view. To start with, you operate with a crop frame and not with an image itself. I’ve successfully used SoundCloud’s library on several projects, but there are still a couple of issues with it that make me sad. Why other open-source libraries aren’t great Let’s take a quick look at the most popular open-source image cropping libraries and explain why they don’t quite fit the bill. But here is the thing: none of these solutions could satisfy our requirements. After all, you can find lots of them on Github and on the Android Arsenal. You might be wondering why we couldn’t just use one of the existing solutions for image cropping for Android. Since we want to provide all our customers with the best set of tools for image editing functionality, we decided to create uCrop, an image cropping library for Android. Image cropping can be used for various purposes, from ordinary adjustment of user profile images to more complex features that involve aspect ratio cropping and flexible image transformations. We develop lots of different Android apps at Yalantis, and our experience shows that almost every application we deal with needs image cropping functionality.
0 Comments
Leave a Reply. |