Android Question If a image file is damaged

appie21

Active Member
Licensed User
Longtime User
Hello

I have a program that load jpg froma http server.
Sometimes there will be found a damged file (the image is half uploaded by the user or is not good)

If i try to load a image into my program i get a error ofcourse

B4X:
2


2


JobName = Job3, Success = true


good


main_jobdone (java line: 355)


java.lang.RuntimeException: Error loading bitmap.


    at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:521)
    at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:499)
    at anywheresoftware.b4a.keywords.Common.LoadBitmap(Common.java:1112)
    at anywheresoftware.b4a.samples.httputils2.httpjob._getbitmap(httpjob.java:116)
    at b4a.example.main._jobdone(main.java:355)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
    at anywheresoftware.b4a.keywords.Common$5.run(Common.java:958)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4998)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
    at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Error loading bitmap.


If i pres yes on my screen the program continous andruns ok (skip loading that image)

How can i Handle These errors?
 
Top