I also use BitmapFactory.decodeStream on images on the sdcard, but I
have no problem.
Does your images work with the standard Pictures application ?

On Sep 30, 4:29 pm, Matteo Crippa <[EMAIL PROTECTED]> wrote:
> Ok, bug filed, but I don't think it could be related to images, i've
> just tested jpgs and pngs, and it fails with both of them...
>
> http://code.google.com/p/android/issues/detail?id=921
>
> On 30 Set, 15:44, Mike Reed <[EMAIL PROTECTED]> wrote:
>
> > Please file a bug for this, and attach one or more of the images and  
> > your code snippet. That will make it much easier to diagnose.
>
> > thanks,
> > mike
>
> > On Sep 30, 2008, at 9:25 AM, Matteo Crippa wrote:
>
> > Hi sahn0 & thanks for the tip, but it still fails with a
> > NullPointerException...
>
> > I tried looking at f.isFile() and it returns true... so file exists...
>
> > On 30 Set, 12:27, sahn0 <[EMAIL PROTECTED]> wrote:
>
> > > Maybe it is jpg format that causing problems? Try converting images to
> > > png.
>
> > > On 30 сент, 16:17, Matteo Crippa <[EMAIL PROTECTED]> wrote:
>
> > >> Easy i was playing with a little app i'm developing but i've just
> > >> found a little problem... let's explain me it...
>
> > >> I created a sdcard and inside it I placed some jpg files.
>
> > >> So my data path is something like:
>
> > >> /sdcard/app/img/1.jpg
> > >> /sdcard/app/img/2.jpg
> > >> /sdcard/app/img/3.jpg
> > >> /sdcard/app/img/4.jpg
> > >> [...]
> > >> /sdcard/app/img/n.jpg
>
> > >> Now I want to create a gallery app to show out these files, I looked
> > >> at demo srcs by android sdk, but they always use imgs from
> > >> resources...
>
> > >> I decided to try using Bitmapfactory.decodeFile and also
> > >> Bitmapfactory.decodestream but both seems not to work fine  
> > >> returning a
> > >> NullPointerException
>
> > >> Here you are a little snippet of my app:
>
> > >> Java:
>
> > >> for(int i=0;i<imgsTokens.length;i++)
> > >>                {
> > >>                     Log.d(""+i,"/sdcard/app/img/"+imgsTokens[i]
> > >> +".jpg");
> > >>                     try
> > >>                     {
> > >>                          FileInputStream is = new FileInputStream(new
> > >> File("/sdcard/app/img/"+imgsTokens[i]+".jpg"));
> > >>                          BufferedInputStream bis = new
> > >> BufferedInputStream(is);
> > >>                          photos[i] = BitmapFactory.decodeStream(is);
> > >>                          bis.close();
> > >>                          is.close();
>
> > >>                          //photos[i] = BitmapFactory.decodeFile("/
> > >> sdcard/app/img/"+imgsTokens[i]+".jpg");
> > >>                     }
> > >>                     catch(Exception e)
> > >>                     {
> > >>                          e.printStackTrace();
> > >>                     }
> > >>                }
>
> > >> any idea how to fix?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to