Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2160] Android: Image scaling tests run time errors

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:16.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M02
ComponentsAndroid
Labelsandroid, android_refactor, defect, image, regression, scaling
ReporterThomas Huelbert
AssigneeDon Thorp
Created2011-04-15T03:12:21.000+0000
Updated2011-04-17T01:58:16.000+0000

Description

1.BaseUI>Views>Image Scaling
results: errrors followed by image loading.

E/KrollCallback(14575): (kroll$17) [86,1006870] ECMA Error evaluating source, invocation: [callMethod Titanium.(anonymous) org.appcelerator.titanium.kroll.KrollCallback@44fe6f48], message: TypeError: Cannot read property "width" from null (app://examples/image_view_scaling.js#33)
E/KrollCallback(14575): org.mozilla.javascript.EcmaError: TypeError: Cannot read property "width" from null (app://examples/image_view_scaling.js#33)
E/KrollCallback(14575): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3761)
E/KrollCallback(14575): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3739)
E/KrollCallback(14575): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3767)
E/KrollCallback(14575): at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3786)
E/KrollCallback(14575): at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3799)
E/KrollCallback(14575): at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1487)
E/KrollCallback(14575): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1408)
E/KrollCallback(14575): at script(app://examples/image_view_scaling.js:33)
E/KrollCallback(14575): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/KrollCallback(14575): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/KrollCallback(14575): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/KrollCallback(14575): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
E/KrollCallback(14575): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
E/KrollCallback(14575): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:97)
E/KrollCallback(14575): at android.os.Handler.handleCallback(Handler.java:587)
E/KrollCallback(14575): at android.os.Handler.dispatchMessage(Handler.java:92)
E/KrollCallback(14575): at android.os.Looper.loop(Looper.java:123)
E/KrollCallback(14575): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)

Comments

  1. Thomas Huelbert 2011-04-15

    1.5.0.70ce98 g2 running 2.2, G1 running 1.6, sim 2.2.

  2. Thomas Huelbert 2011-04-15

    persists in todays pull - 1.5.0.91838a, don't think its user error? droid 1 (2.2)

  3. Bill Dawson 2011-04-15

    Weird, the error doesn't happen on an emulator for me, nor on my HTC Desire 2.2 device. But then on a whim I turned off the network on my device and indeed the error occurs.

    This is a remote image that's being scaled. The KS test is checking imageView.toBlob().width without checking if toBlob() returns null, so in that case the runtime error isn't surprising. I'm going to change the test slightly to account for this gracefully and put up the message that image wasn't retrieved.

    Meanwhile, Thomas, are you getting the error also when you're network connection is active? Put another way: are you able to run the remote image test successfully but then not the image scaling test in the same session? (That would be odd.)

  4. Bill Dawson 2011-04-15

    (from [c0aff27b322129e48f2092c569efff33a9b0a4a3]) [#2160] Check for blob being null before trying to read its dimensions. https://github.com/appcelerator/titanium_mobile/commit/c0aff27b322129e48f2092c569efff33a9b0a4a3"> https://github.com/appcelerator/titanium_mobile/commit/c0aff27b3221...

  5. Thomas Huelbert 2011-04-15

    Titanium SDK version: 1.5.0 (12/04/10 08:46 b7b9e78) G2 (2.2) sim 2.1

JSON Source