color v 1.3 App crash after opened image and click in"touch to see color

in #utopian-io5 years ago

PROJECT INFORMATION

REPOSITORIES: https://github.com/njzjz/Color-android
issues : https://github.com/njzjz/Color-android/issues/15

EXPECTED BEHAVIOR

this application will display the color name when the user wants to see the color of a photo they choose

ACTUAL BEHAVIOR

the app will crash when user click on touch to see color

STEP TO REPRODUCE

  • install and open the app
  • click on open option
  • chose any pic
  • click on touch to see color and note the bug

ERROR RECORDING


BROWSER
OS :ANDROID 6.1
DEVICE :OPPO NEO 5
APP :COLOR V1.3
Here is log cat

Process: com.njzjz.color, PID: 24301
java.lang.ArithmeticException: divide by zero
    at com.njzjz.color.MainActivity.getrgb(MainActivity.java:329)
    at com.njzjz.color.MainActivity$3.onTouch(MainActivity.java:224)
    at android.view.View.dispatchTouchEvent(View.java:8582)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2530)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2530)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2530)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2530)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2530)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2530)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2538)
    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1811)
    at android.app.Activity.dispatchTouchEvent(Activity.java:2820)
    at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2476)
    at android.view.View.dispatchPointerEvent(View.java:8799)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4729)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4551)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4047)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4106)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4066)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4209)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4074)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4266)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4047)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4106)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4066)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4074)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4047)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6530)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6504)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6457)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6689)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:218)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:148)
    at android.os.Looper.loop(Looper.java:168)
    at android.app.ActivityThread.main(ActivityThread.java:5657)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:990)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:785)```
Sort:  

Hi @muhammadarif, thanks for making this contribution

I can see that the contribution has been acknowledged by the PO. I love that you included a logcat but these days we expect a bit of analysis to complement the stack trace. Some explanations on what could have possibly gone wrong

Still a good post. We look forward to more of your reports

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @fego! Keep up the good work!

Hey, @muhammadarif!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hi, @muhammadarif!

You just got a 0.05% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Coin Marketplace

STEEM 0.28
TRX 0.14
JST 0.036
BTC 62275.68
ETH 3440.90
USDT 1.00
SBD 4.46