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

Doesn't work. Even the provided sample doesn't work #1

Open
debryan opened this issue Aug 8, 2015 · 3 comments
Open

Doesn't work. Even the provided sample doesn't work #1

debryan opened this issue Aug 8, 2015 · 3 comments

Comments

@debryan
Copy link

debryan commented Aug 8, 2015

Error: Bitmap height must be greater than zero.

The crop window is not shown.

@CrazyOrr
Copy link
Owner

What is your testing environment? Device or emulator? Upon which sdk version?
And did you take a picture or select a legimate image from file system?
If you could, the error logcat will be appreciated.

@debryan
Copy link
Author

debryan commented Aug 10, 2015

Tested it on a device with Android 5.1, with sdcard. I took an image from the filesystem. The image is shown under a translucent dark window but the cropping area is not shown. When I press the confirm button it crashes with the following error.

Here is the logcat

08-10 15:25:29.972: E/JHEAD(11224): can't open '/document/image:28124'
08-10 15:25:32.566: E/AndroidRuntime(11224): FATAL EXCEPTION: main
08-10 15:25:32.566: E/AndroidRuntime(11224): Process: com.wl.zoomcropimage.sample, PID: 11224
08-10 15:25:32.566: E/AndroidRuntime(11224): java.lang.IllegalArgumentException: width must be > 0
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.graphics.Bitmap.checkWidthHeight(Bitmap.java:379)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.graphics.Bitmap.createBitmap(Bitmap.java:670)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.graphics.Bitmap.createBitmap(Bitmap.java:639)
08-10 15:25:32.566: E/AndroidRuntime(11224): at com.wl.zoomcropimage.ZoomCropImageView.crop(ZoomCropImageView.java:415)
08-10 15:25:32.566: E/AndroidRuntime(11224): at com.wl.zoomcropimage.CropImageLayout.crop(CropImageLayout.java:110)
08-10 15:25:32.566: E/AndroidRuntime(11224): at com.wl.zoomcropimage.ZoomCropImageActivity.onClick(ZoomCropImageActivity.java:133)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.view.View.performClick(View.java:4802)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.view.View$PerformClick.run(View.java:20101)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.os.Handler.handleCallback(Handler.java:810)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.os.Handler.dispatchMessage(Handler.java:99)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.os.Looper.loop(Looper.java:189)
08-10 15:25:32.566: E/AndroidRuntime(11224): at android.app.ActivityThread.main(ActivityThread.java:5530)
08-10 15:25:32.566: E/AndroidRuntime(11224): at java.lang.reflect.Method.invoke(Native Method)
08-10 15:25:32.566: E/AndroidRuntime(11224): at java.lang.reflect.Method.invoke(Method.java:372)
08-10 15:25:32.566: E/AndroidRuntime(11224): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
08-10 15:25:32.566: E/AndroidRuntime(11224): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)

@CrazyOrr
Copy link
Owner

It's odd but it seems either
a) the onSizeChanged() callback of CropImageLayout never gets called,
b) the onSizeChanged() callback of CropImageLayout gets called with w=0 and/or h=0.

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

2 participants