-
Notifications
You must be signed in to change notification settings - Fork 749
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
IllegalArgumentException: Both dimensions must be greater than 0 #272
Comments
I have the same issue now, any answer? |
I'm seeing the same crash occuring on some devices in the wild (haven't repro'ed it locally yet). It's happening on an iPhone XS Max with iOS 12.0.1. Any ideas on where to look, or what might trigger this?
|
Interesting. It should not be invoked with a dimension lower or equal than zero. I am trying to investigate the bug this week. |
@benjohnde It's definitely a frequent occurrence in our app, I'm seeing 143 errors reported so far. 80% on iPhone XS Max if that helps pinpoint it (the rest are on iPhone XR). The one thing that I see in the trace breadcrumbs is that there appears to be a transition from portrait to landscapeleft on the device a few seconds before the crash. I don't have an XS Max or XR to physically test with, and haven't been able to repro with the remote test service I use. |
@dpolivy not quite sure. Could be related to rotation. It seems to me (maybe you can recheck that with your stack traces), that it always happens here: https://github.com/TheLevelUp/ZXingObjC/blob/master/ZXingObjC/common/ZXHybridBinarizer.m#L70 Which basically indicates some weird behaviour, because the image should "never" be that small. Hence, I assume that the incoming |
I am investigating the issue a bit more and going to prepare a fix this week. Maybe due to rotation the incoming image is just empty (zero). |
Something like TheLevelUp/ZXingObjC@e5326ed |
I am still doing some tests and diving through the code. |
It'd be much better if I had an XS Max to use for repro testing 😄 I think you're right on ZXHybridBinarizer.m being in the middle of it. The stack is pretty consistent, basically the same as what I posted earlier in the thread. It's going through |
Yeah, you are right. Either it is coming back negative or zero. Both would lead to this issue. Should be fixed with the latest commit. I am going to fix a bunch of other stuff and then releasing |
@dpolivy I released the fix with 3.6.2. Hopefully it serves you well! |
@benjohnde Thanks! Will incorporate into my next app rev. But, does code handle the negative case, or just 0 case? Bigger question, if it is negative/zero, is that a sign of an issue higher up the chain? Should the QR code reader work if the device is rotated? |
@dpolivy you are right, now the fix also handles negative values. Hmm good question, hard for me to test it here. I believe it could be an issue higher up the chain. I believe the QR code reader works even if the device is rotated. Maybe one or two frames directly after the rotation may misbehave. Could also be an error in |
i am getting crash on my device while open QR Scanner.
Throw exception in ZXBitMatrix.m line no: 34
Method Name: - (id)initWithWidth:(int)width height:(int)height
OS running in Device: iOS 9.2
: CGContextSetAllowsAntialiasing: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
: CGContextSetInterpolationQuality: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
: CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
: CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Both dimensions must be greater than 0'
*** First throw call stack:
(0x180a39900 0x1800a7f80 0x1000edd14 0x100133920 0x100134f80 0x1000ead90 0x100184e68 0x100145744 0x1001445e8 0x1000f7d3c 0x186ce74c0 0x186ce7358 0x1829f4084 0x182a0fcf4 0x10143dbb0 0x101455f54 0x101440154 0x10144a8e4 0x1014418a0 0x10144a8e4 0x1014418a0 0x10144c7e0 0x10144c4d8 0x1806a1470 0x1806a1020)
The text was updated successfully, but these errors were encountered: