- Crop image android kotlin
- About
- Crop image android kotlin
- About
- Image Cropping Library for Android, optimised for Camera / Gallery.
- Related tags
- [BUG] — Not working on Android 11
- [BUG] — NPE when accepting a photo on Android 11
- [hacktoberfest] — image pick option
- Description
- Possible solution:
- Error: open failed: ENOENT (No such file or directory)
- Implementation Error
- Gallery option is not showing
- [BUG] — Unable to Crop image from Uri
- Additional context
- [hacktoberfest] — UI tests
- Stop requiring Personal Access Token
- [BUG] — Getting uriContent as null in CropImageView.CropResult
- Cannot build with Java 8, which breaks some CI builds
- Release 4.0.0
- Todo List
- CHANGELOG
- Fixed
- Changed
- Removed
- [BUG] — FileUriExposedException when trying to lunch only camera intent.
- Camera permissions request was asked when camera option by user was t…
- Template 1 [New Feature]
- Description:
- Check list for the Code Reviewer:
- Template 2 [Bug]
- Cause:
- Reproduce
- How the bug was solved:
- [BUG] — Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f080126
- Update strings.xml
- [BUG] — MIUI (Xiaomi) cant pick image from gallery
- [BUG] — Image Too Large
- [BUG] — ScaleType Problem
- [Feat] — One Degree Rotation
Crop image android kotlin
Android Image Cropper
Powerful (Zoom, Rotation, Multi-Source), customizable (Shape, Limits, Style), optimized (Async, Sampling, Matrix) and simple image cropping library for Android.
For a working implementation, please have a look at the Sample Project
Add permissions to manifest
Add this line to your Proguard config file
- Add CropImageActivity into your AndroidManifest.xml
- Start CropImageActivity using builder pattern from your activity
- Override onActivityResult method in your activity to get crop result
- Add CropImageView into your activity
- Built-in CropImageActivity .
- Set cropping image as Bitmap, Resource or Android URI (Gallery, Camera, Dropbox, etc.).
- Image rotation/flipping during cropping.
- Auto zoom-in/out to relevant cropping area.
- Auto rotate bitmap by image Exif data.
- Set result image min/max limits in pixels.
- Set initial crop window size/location.
- Request cropped image resize to specific size.
- Bitmap memory optimization, OOM handling (should never occur)!
- API Level 14.
- More..
- Cropping window shape: Rectangular or Oval (cube/circle by fixing aspect ratio).
- Cropping window aspect ratio: Free, 1:1, 4:3, 16:9 or Custom.
- Guidelines appearance: Off / Always On / Show on Toch.
- Cropping window Border line, border corner and guidelines thickness and color.
- Cropping background color.
For more information, see the GitHub Wiki.
- Fix crash on Android O (thx @juliooa)
- Update to support library to AndroidX (thx @mradzinski)
- Handle failure when selecting non image file (thx @uncledoc)
- More translations (thx @jkwiecien, @david-serrano)
- Update gradle wrapper to 4.4
- Update support library to 27.1.1 and set is statically! (thx @androideveloper)
- Fix NPE in activity creation by tools (thx @unverbraucht)
- More translations (thx @gwharvey, @dlackty, @JairoGeek, @shaymargolis)
Originally forked from edmodo/cropper.
Copyright 2016, Arthur Teplitzki, 2013, Edmodo, Inc.
Licensed under the Apache License, Version 2.0 (the «License»); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
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.
About
Image Cropping Library for Android, optimized for Camera / Gallery.
Источник
Crop image android kotlin
Wanna help the project? Amazing!
Android Image Cropper
Powerful (Zoom, Rotation, Multi-Source); Customizable (Shape, Limits, Style); Optimized (Async, Sampling, Matrix); Simple image cropping library for Android.
Add to your project
Step 1. Add the JitPack repository to your root build.gradle
Step 2. Add the dependency
Step 3. Add permissions to manifest
Only need if you run on devices under OS10 (SDK 29)
Step 4. Set source compatibility version to Java 11
The library is up to date with the latest releases, if you are not using Java 11 yet please check the release page for previous working versions.
Go to app level build.gradle file
Add this line inside android in build.gradle
This expects Gradle 7.0+
Using the Library
There is 3 ways of using the library:
- Calling crop directly (Sample code: sample/crop_image )
- Using the CropView (Sample code: sample/crop_image_view )
- Extending the activity (Sample code: sample/extend_activity ) Your choice depends on how you want your layout to look.
Obs: The library has a public pick image contract, more on wiki.
Calling crop directly
- Register for activity result with CropImageContract
- Add CropImageView into your activity
Extend to make a custom activity
If you want to extend the CropImageActivity please be aware you will need to setup your CropImageView You can check a sample code in this project com.canhub.cropper.sample.extend_activity.app.SExtendActivity
- Add CropImageActivity into your AndroidManifest.xml
- Setup your CropImageView after call super.onCreate(savedInstanceState)
Custom dialog for image source pick
When calling crop directly the library will prompt a dialog for the user choose between gallery or camera (If you keep both enable). We use the Android default AlertDialog for this. If you wanna customised it with your app theme you need to override the method showImageSourceDialog(..) when extending the activity (above)
- Built-in CropImageActivity .
- Set cropping image as Bitmap, Resource or Android URI (Gallery, Camera, Dropbox, etc.).
- Image rotation/flipping during cropping.
- Auto zoom-in/out to relevant cropping area.
- Auto rotate bitmap by image Exif data.
- Set result image min/max limits in pixels.
- Set initial crop window size/location.
- Request cropped image resize to specific size.
- Bitmap memory optimization, OOM handling (should never occur)!
- API Level 14.
- More..
- Cropping window shape: Rectangular, Oval (square/circle by fixing aspect ratio), as well as rectangular modes which only allow vertical or horizontal cropping.
- Cropping window aspect ratio: Free, 1:1, 4:3, 16:9 or Custom.
- Guidelines appearance: Off / Always On / Show on Touch.
- Cropping window Border line, border corner and guidelines thickness and color.
- Cropping background color.
For more information, see the GitHub Wiki.
Forked from ArthurHub Originally forked from edmodo/cropper.
Copyright 2016, Arthur Teplitzki, 2013, Edmodo, Inc.
Licensed under the Apache License, Version 2.0 (the «License»); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
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.
About
Image Cropping Library for Android, optimised for Camera / Gallery.
Источник
Image Cropping Library for Android, optimised for Camera / Gallery.
Related tags
Overview
Wanna help the project? Amazing!
Android Image Cropper
Powerful (Zoom, Rotation, Multi-Source); Customizable (Shape, Limits, Style); Optimized (Async, Sampling, Matrix); Simple image cropping library for Android.
Add to your project
Step 1. Add the JitPack repository to your root build.gradle
Step 2. Add the dependency
Step 3. Add permissions to manifest
Only need if you run on devices under OS10 (SDK 29)
Step 4. Add this line to your Proguard config file
Step 5. Set source compatibility version to Java 8
Go to app level build.gradle file
Add this line inside android in build.gradle
This will set the java version to 8
Using the Library
There is 3 ways of using the library:
- Calling crop directly (Sample code: sample/crop_image )
- Using the CropView (Sample code: sample/crop_image_view )
- Extending the activity (Sample code: sample/extend_activity ) Your choice depends on how you want your layout to look.
Obs: The library has a public pick image contract, more on wiki.
Calling crop directly
- Register for activity result with CropImageContract
- Add CropImageView into your activity
Extend to make a custom activity
If you want to extend the CropImageActivity please be aware you will need to setup your CropImageView You can check a sample code in this project com.canhub.cropper.sample.extend_activity.app.ExtendActivity
- Add CropImageActivity into your AndroidManifest.xml
- Setup your CropImageView after call super.onCreate(savedInstanceState)
- Built-in CropImageActivity .
- Set cropping image as Bitmap, Resource or Android URI (Gallery, Camera, Dropbox, etc.).
- Image rotation/flipping during cropping.
- Auto zoom-in/out to relevant cropping area.
- Auto rotate bitmap by image Exif data.
- Set result image min/max limits in pixels.
- Set initial crop window size/location.
- Request cropped image resize to specific size.
- Bitmap memory optimization, OOM handling (should never occur)!
- API Level 14.
- More..
- Cropping window shape: Rectangular, Oval (square/circle by fixing aspect ratio), as well as rectangular modes which only allow vertical or horizontal cropping.
- Cropping window aspect ratio: Free, 1:1, 4:3, 16:9 or Custom.
- Guidelines appearance: Off / Always On / Show on Touch.
- Cropping window Border line, border corner and guidelines thickness and color.
- Cropping background color.
For more information, see the GitHub Wiki.
Forked from ArthurHub Originally forked from edmodo/cropper.
Copyright 2016, Arthur Teplitzki, 2013, Edmodo, Inc.
Licensed under the Apache License, Version 2.0 (the «License»); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
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.
Issues
[BUG] — Not working on Android 11
🚨🚨 Not working in android 11
Not working on my device (Poco M2 Pro Android 11 MIUI 12.0.1). CropView doesn’t open after chosing the image, neither from gallery nor from camera. The activity simply gets finished. In the sample code it works when «Outside Camera and Start(Uri)’ is selected. In the rest of the cases (refer sample code) it throws following error: —Library Camera, Start(), Custom Option : «cropping image was cancelled by the user» —Custom Selector Title. : «picking image failed» —Library show pick option. : «picking image failed»
To Reproduce Steps to reproduce the behavior:
- Launch the sample app
- Click on «Sample CallingCrop Image»
- Click on «Library, Camera, Start(), Custom Option»
- Pick image from gallery or click using camera
- See the toast message
Expected behavior CropView should open on clicking the image in the gallery or after clicking on done icon if clicked from camera and uri should be returned in the required activity
- Device: Poco M2 Pro (MIUI 12.0.1)
- OS: Android 11
Additional context In parseResult method in PickImageContract class the result code is always 0 so the Activity.RESULT_CANCELED is called everytime. Also in CropImageActivity: private val pickImage: ActivityResultLauncher = registerForActivityResult(PickImageContract()) < onPickImageResult(it) >The returned Uri is always null
[BUG] — NPE when accepting a photo on Android 11
Describe the bug A user that opts to take a photo can capture a picture and upon accepting the photo (aka, tapping on the check mark) they are returned to destination that launched CropImageActivity.
What’s happening is an NPE is thrown (see below) when user accepts the photo, CropImageActivity.onActivityResult is called with resultCode == RESULT_CANCELED .
2021-02-10 09:45:14.860 6815-6815/? E/CAM_StateMachine: Failed to process event: com.[email protected]f96e55
2021-02-10 09:45:14.861 6815-6815/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.android.camera2, PID: 6815 java.lang.NullPointerException at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:890) at com.google.common.base.Optional.of(Optional.java:103) at com.android.camera.captureintent.state.StateSavingPicture.onEnter(StateSavingPicture.java:77) at com.android.camera.captureintent.stateful.StateMachineImpl.jumpToState(StateMachineImpl.java:62) at com.android.camera.captureintent.stateful.StateMachineImpl.processEvent(StateMachineImpl.java:110) at com.android.camera.captureintent.state.StateOpeningCamera$9.onClick(StateOpeningCamera.java:307) at android.view.View.performClick(View.java:7448) at android.view.View.performClickInternal(View.java:7425) at android.view.View.access$3600(View.java:810) at android.view.View$PerformClick.run(View.java:28305) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
To Reproduce Steps to reproduce the behavior:
- From CropImageActivity, select Camera option
- Accept permissions if needed
- Take photo
- Accept Photo
- CropImageActivity is cancelled, NPE reported above is thrown.
Expected behavior
- From CropImageActivity, select Camera option
- Accept permissions if needed
- Take photo
- Accept Photo
- CropImageActivity proceeds to crop image
Screenshots N/A
Smartphone (please complete the following information):
- Device: Emulator, Pixel 3a
- OS: API 30
Additional context Add any other context about the problem here.
[hacktoberfest] — image pick option
Description
Today the user can use the library to pick images from camera, gallery or documents
But the user cannot select that is from camera only, for example. So we need to add a parameter to the contract that define which intents we will use for selection.
Possible solution:
PickImageContract would receive a data class, like we have in CropImageContract and this data class will contain booleans for each type of selection camera/gallery/etc in the case that if you only choose one it open directly
good first issue help wanted pinned hacktoberfest
Error: open failed: ENOENT (No such file or directory)
After cropping image i found this issue that says Error: open failed: ENOENT (No such file or directory)
To Reproduce Steps to reproduce the behavior:
- After setup library
- Start CropImageActivity
- Then crop image then it will show
Expected behavior In previous library of https://github.com/edmodo/cropper its working fine but in your library its showing above error
Screenshots
Smartphone :
- Device: Infinix note 7
- OS: 10
bug pinned on progress
Implementation Error
Android Studio Throws error: «Fail to resolve: com.github.CanHub:Android-Image-Cropper:3.1.3»
Gallery option is not showing
Using Android Studio 3.6.3
I followed the steps as given but only camera and file options show up in the intent . The gallery option is not visible.I am also using the latest version of the library.
[BUG] — Unable to Crop image from Uri
Describe the bug First of all I would like to thank everyone involved in this library for the great work you have done. Well done.
I am currently using this library in a project where I have a personalized interface where the user can take a photo. When he takes the picture I take this uri and send it to another screen to edit the image. On this screen I have a button to crop the image, which is where I call the CropImage.
This is the contract:
However, when I call the method, the CropImage’s Activity is called and is immediately closed returning the Uri as null.
This is what I was able to see in the log (I don’t know if it’s related but it appears every time I press the button) :
I have another feature which is the creation of a profile, there I call this contract and everything is working correctly:
The problem is only when I already send Uri directly. Am I doing something wrong?
To Reproduce Call CropImage Passing the Uri from fragment:
Expected behavior Open the CropImage activity to crop the provided Uri
Screenshots If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
- Pixel 2 XL Android 11
- Samsung Galaxy S9+ Android 10
Additional context
[hacktoberfest] — UI tests
We need emulator UI tests using our sample code
good first issue help wanted pinned hacktoberfest
Stop requiring Personal Access Token
I suppose it’s in the list of planned things to do, but I really don’t like including credentials in build.gradle 😅 (or in gradle.properties like you mention in the guide)
EDIT: By this I mean doing whatever changes are needed so a Personal Access Token for GitHub isn’t necessary, i’ve edited the previous title
feature help wanted
[BUG] — Getting uriContent as null in CropImageView.CropResult
🚨🚨 Before open the ticket please check if you can reproduce the bug in the sample code
Describe the bug I have created a custom activity which includes CropImageView in my XML. Using DataBinding. I am passing uri to cropImageView.setImageUriAsync(incomingUri) and getting uri in cropImageView.setOnSetImageUriCompleteListener().
For getting Cropped result I have used async method cropImageView.getCroppedImageAsync(), which gives me result in Bitmap but uriContent is Null.
Expected behavior I should get the uriContent so that I can pass the uri back to fragment where I want to show the Cropped Image.
Media When I click on the Center Check button I am calling cropImageView.getCroppedImageAsync()
Smartphone (please complete the following information):
- Device: [Xiomi A3, Android 11]
- OS: [Android 11]
Additional context Add any other context about the problem here.
Cannot build with Java 8, which breaks some CI builds
Describe the bug The build fails on machines that have Java 8
To Reproduce
- Take an Android project that successfully builds on a particular machine with JDK 8.
- The project targets Java 8 (1.8). It uses gradle plugin 4.2.2, gradle 6.9, jettifier (with desugar_jdk_libs)
- Add the Android-Image-Cropper library to the project.
- Start a build on the CI and see the results — the build fails (see the log below)
Expected behavior The build should succeed, the same way as before adding the library.
Additional context
Version 55 corresponds to Java 11, and 52 corresponds to Java 8.
Release 4.0.0
close #271 close #253 close #274
Todo List
- [x] CHANGELOG
- [x] README
- [x] Version Number
- [x] Update min version following Android deprecated versions
- [x] Remove all permissions needs for getting pictures, using Activity Contract
- [x] Remove previous deprecated methods
- [x] Remove pick image contract
- [ ] Improve image source selection layout
CHANGELOG
Fixed
- Issue where some devices based on MIUI would not retrieve image from gallery #253
Changed
- minSdkVersion = 16 , previous versions have been deprecated by Google.
Removed
- Pick Image, now the library will handle this without expose the contract #271
- Need for READ_EXTERNAL_STORAGE permission #271
- Previous deprecated ActivityBuilder , startPickImageActivity , getActivityResult and onActivityResult #145
[BUG] — FileUriExposedException when trying to lunch only camera intent.
Describe the bug App gets crashed when I want to open only camera intent .
java.lang.RuntimeException: Unable to start activity ComponentInfo
To Reproduce Steps to reproduce the behavior: in a crop image sample use this part of code. private val customCropImage = registerForActivityResult(CropImageContract())
Media
Smartphone (please complete the following information):
Device: Xiaomi2 mi a2
OS: API Level 30
Device: Android emulator
OS: API Level 28, 29
bug pinned on progress
Camera permissions request was asked when camera option by user was t…
Add the issue linked to this PR close #
Please choose one of the two templates and delete this message and the other template
Template 1 [New Feature]
Description:
very small explanation about what was done
Check list for the Code Reviewer:
- [ ] CHANGELOG
- [ ] README
- [ ] Wiki
- [ ] Version Number
Template 2 [Bug]
Cause:
Reproduce
more detail steps better GIVEN: WHEN: THEN:
How the bug was solved:
[BUG] — Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f080126
Describe the bug App is got crash in only NEXUS 5X device. I am attaching here the log of crash which is received in crashlytics
CrashLog
I thought the issue is within my app core drawables used. But when I used this to find out which drawable is doing the crash. I found below attached screenshot.
Then after check in project. Which lib is using this resource file. I found below attached screenshot
To Reproduce Steps to reproduce the behavior: Use in below mentioned device.
Expected behavior It should not crash in any device because of resource file. File should place in anydpi resource folder to prevent this.
Media Please add screenshots and/or screen recordings to help explain your problem. Added all required screenshots in description.
Smartphone (please complete the following information):
Update strings.xml
I have changed translations in values-hi/strings.xml. They were not correct.
Crop was literally translated to Field Crop, I have corrected it along with a few others.
[BUG] — MIUI (Xiaomi) cant pick image from gallery
Phone Model: Xiomi Redmi K20 Pro Version: Android 11 (RQ1.200826.002) CanHub Version: 3.3.5
I tried your sample project & run it. But it didn’t work on my phone. Also, I uploaded a video for the issue.
Please check & replay.
bug pinned on progress
[BUG] — Image Too Large
Application getting crashed if we capturing/uploading image above 5 MB.
Fatal Exception: java.lang.RuntimeException: Canvas: trying to draw too large(253247232bytes) bitmap. at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:281) at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:91) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:548) at android.widget.ImageView.onDraw(ImageView.java:1453) at android.view.View.draw(View.java:23901) at android.view.View.updateDisplayListIfDirty(View.java:22776) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1994) at android.view.View.draw(View.java:23904) at android.view.View.updateDisplayListIfDirty(View.java:22776) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1994) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.draw(View.java:23904) at androidx.core.widget.NestedScrollView.draw(NestedScrollView.java:1999) at android.view.View.updateDisplayListIfDirty(View.java:22776) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1994) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.draw(View.java:23904) at android.view.View.updateDisplayListIfDirty(View.java:22776) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1277) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.updateDisplayListIfDirty(View.java:22762) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:5336) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093) at android.view.View.draw(View.java:23904) at com.android.internal.policy.DecorView.draw(DecorView.java:1282) at android.view.View.updateDisplayListIfDirty(View.java:22776) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:579) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:585) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:662) at android.view.ViewRootImpl.draw(ViewRootImpl.java:5042) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4749) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3866) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2618) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9965) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010) at android.view.Choreographer.doCallbacks(Choreographer.java:809) at android.view.Choreographer.doFrame(Choreographer.java:744) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8506) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
Steps to reproduce:
- Capture image with full resolution
- scale it to full
- click on crop button
After click on crop , app is getting crashed.
- Device: [Samsung all devices]
- OS: [11]
bug good first issue help wanted pinned
[BUG] — ScaleType Problem
🚨🚨 Before open the ticket please check if you can reproduce the bug in the sample code
Describe the bug I think that scale type is not working (Or I’m doing something wrong). When I have CropImageView with ratio for example 3×5 and I want to crop square image and im setting ScaleType to CENTER_CROP I would expect that preview of image will be filled (like in android ImageView).
To Reproduce Steps to reproduce the behavior:
- In extended_activity.xml add app:cropScaleType=»centerCrop» to
- Run sample app
- click «SAMPLE OF CUSTOM ACTIVITY»
- Pick/take square photo
- Go to crop screen
- CropImageView is not filled
Expected behavior Image should fill whole CropImageView
Media
Smartphone (please complete the following information):
- Device: xiaomi mi a 2 lite
- OS: Android 9
Additional context But maybe Im doing something wrong 😀
bug good first issue help wanted pinned
[Feat] — One Degree Rotation
The library today already rotate images using 90 , 180 , 270 and 360 angles
The goal is to be able to rotate it by 1 degree difference.
For that will be need to auto zoom crop the image:
- Let’s say the CropOverlay is the same size as the image.
- When we rotate 5 degrees it will be getting «outside» image area
- So is need to push the CropOverlay inside and create new limits
Add ui rotation selector, like a carrousel from 0-360
feature good first issue help wanted pinned
Источник