Android Question How to know a corrupted file?

khosrwb

Active Member
Licensed User
Longtime User
hello
I have a crashed photo file.
How to know a corrupted file?
thanks

this is log error:

1520782279024.jpg
Error occurred on line: 102 (Main)
java.lang.RuntimeException: Error loading bitmap.
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:539)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:517)
at anywheresoftware.b4a.keywords.Common.LoadBitmap(Common.java:1299)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
at b4a.example.main._listfile(main.java:438)
at b4a.example.main._listview1_itemclick(main.java:773)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$1.run(BA.java:325)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
 
I would check if it is really broken (via gallery or similar). However. The only way is to use try... catch... to intercept the exception. Another good idea is to check how you broke it and solve the cause, too.
 
Upvote 0
Reload and then resave the photo in your chosen gfx/photo software.
 
Upvote 0
Reload and then resave the photo in your chosen gfx/photo software.

So if it's "broken" it's "broken" and can't be loaded anymore (even on PC except special tools to repair which would be a non B4A question). I assume he was asking about to check if it IS and prevent the app from crashing :-)
 
Upvote 0
So if it's "broken" it's "broken" and can't be loaded anymore (even on PC except special tools to repair which would be a non B4A question). I assume he was asking about to check if it IS and prevent the app from crashing :)

I only said it because I had an issue where B4A wouldn't load an image of mine, after re-saving t it worked, it's as simple as that really. If it works it works, it not then sod it. It loaded perfect in Photoshop so I just re-saved my image and it worked afterwards, he can only try it, it will not kill him ;). If it appears to load perfect and looks good in your photo editor then just re-save it and try it again, who knows.
 
Last edited:
Upvote 0
Back
Top