koush / ion

Android Asynchronous Networking and Image Loading
Other
6.29k stars 1.03k forks source link

LoadDeepZoom.run FileCache NullPointerException When Loading Local Animated GIF #499

Open touhonoob opened 9 years ago

touhonoob commented 9 years ago

The issue is caused by loading local animated gif resource Uri with DeepZoom https://github.com/koush/ion/blob/master/ion/src/com/koushikdutta/ion/LoadDeepZoom.java#L64

 java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileInputStream com.koushikdutta.async.util.FileCache.get(java.lang.String)' on a null object reference
    at com.koushikdutta.ion.LoadDeepZoom$1.run(LoadDeepZoom.java:64)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
fuwaneko commented 9 years ago

Same here with latest version.

java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileInputStream com.koushikdutta.async.util.FileCache.get(java.lang.String)' on a null object reference
            at com.koushikdutta.ion.LoadDeepZoom$1.run(LoadDeepZoom.java:69)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
MFlisar commented 8 years ago

I could see this happening with a filename that ends with an upper case GIF. Renaming the file helped...

Probably calling ion with the filename.toLowerCase () is a workaround for that... haven't tried it yet though, but will try this soon

mcp98252302 commented 8 years ago

Still got this problem with latest version. Anyone help?