tags:

views:

28

answers:

0

Hi Friends, I have parsed an url, and displayed it contents, in that several images are available, all images are displayed correctly, but when i want to display the following url image, i got skia decoder returned false, i had searched the net and used the following solutions, but all solutions did not help me to fix this issue, can any one tell me what i have to do to eliminate this issue. Pls Note this, this image is loaded successfully in Mozila and safari , but this not loaded in Internet Explorer.

Thanks

the url in image which holds is link text

All solutions shown below are not working for me, so please guide what is the problem in this solution and what is remdey measure to fix this issue. Solution 1:

 HttpGet httpRequest = null;
 URL newurl = new URL(url);
 String bimage=newurl.toString();
 httpRequest = new HttpGet(bimage);
 BitmapFactory.Options bmOptions;
 bmOptions = new BitmapFactory.Options();
 bmOptions.inSampleSize = 1;
 HttpClient httpclient = new DefaultHttpClient();
 HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
 HttpEntity entity = response.getEntity();
 BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity); 
 InputStream instream = bufHttpEntity.getContent();
 mIcon_val = BitmapFactory.decodeStream(instream,null,bmOptions);

Solution 2:

public class PatchInputStream extends FilterInputStream {
      public PatchInputStream(InputStream in) {
        super(in);
      }
      public long skip(long n) throws IOException {
        long m = 0L;
        while (m < n) {
          long _m = in.skip(n-m);
          if (_m == 0L) break;
          m += _m;
        }

        return m;
      }


 InputStream in = new java.net.URL(bimage).openStream();
   mIcon_val = BitmapFactory.decodeStream(new PatchInputStream(in));

Solution 3: got from this url http://stackoverflow.com/questions/3802820/bitmapfactory-decodestream-always-returns-null-and-skia-decoder-shows-decode-retu/4040253#4040253