Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with height #15

Open
dan085 opened this issue Apr 6, 2020 · 1 comment
Open

issue with height #15

dan085 opened this issue Apr 6, 2020 · 1 comment

Comments

@dan085
Copy link

dan085 commented Apr 6, 2020

this line its the problem


     viewModel
            .getResizedBitmapLiveData()
            .observe(viewLifecycleOwner, Observer { binding.cropView.setBitmap(it.bitmap) })

java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:1113)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1080)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1030)
at android.graphics.Bitmap.createBitmap(Bitmap.java:991)
at com.lyrebirdstudio.croppylib.cropview.CropView.createMaskBitmap(CropView.kt:525)
at com.lyrebirdstudio.croppylib.cropview.CropView.initialize(CropView.kt:510)
at com.lyrebirdstudio.croppylib.cropview.CropView.setBitmap(CropView.kt:404)
at com.lyrebirdstudio.croppylib.ui.ImageCropFragment$onActivityCreated$2.onChanged(ImageCropFragment.kt:119)
at com.lyrebirdstudio.croppylib.ui.ImageCropFragment$onActivityCreated$2.onChanged(ImageCropFragment.kt:17)
at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
at com.lyrebirdstudio.croppylib.ui.ImageCropViewModel$setCropRequest$1.accept(ImageCropViewModel.kt:38)
at com.lyrebirdstudio.croppylib.ui.ImageCropViewModel$setCropRequest$1.accept(ImageCropViewModel.kt:18)
at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62)
at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

@dan085
Copy link
Author

dan085 commented Apr 6, 2020

**** I add this line

binding.cropView.post(Runnable { binding.cropView.setBitmap(it.bitmap) })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant