Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Can not display large GIF image

Can not display large GIF image

All your problems with Audio, Video and Images.

Can not display large GIF image

Postby muniraju » Wed Jul 15, 2009 9:14 am

I have following code to display a image

Code: Select all
public void setBackgroundImage(Uri uri) throws FileNotFoundException {
        InputStream is = null ;
        try {
            Bitmap bm;
            BitmapFactory.Options opt =  new BitmapFactory.Options();
            opt.inJustDecodeBounds = true;
            BitmapFactory.decodeStream(is, null, opt);
            opt.inSampleSize = 1;
            Display d;
                WindowManager wm = (WindowManager) getContext().getSystemService(
                        Context.WINDOW_SERVICE);
                d = wm.getDefaultDisplay();
                h = d.getHeight();
                w = d.getWidth();
            while ((opt.outWidth/opt.inSampleSize) > w ||
                            (opt.outHeight/opt.inSampleSize) > h ) {
                   opt.inSampleSize <<= 1;
             }
             opt.inJustDecodeBounds = false;
            is = getContext().getContentResolver().openInputStream(
                    uri);
            bm = BitmapFactory.decodeStream(is, null, opt);

            super.setImageBitmap(bm);
        } catch (IOException e) {
            if ( e instanceof FileNotFoundException){
                throw (FileNotFoundException)e;
            }else {
                Log.e("CompositeImage", "Failed to decode"
                    + e.toString());
            }
        }finally {
            if (null != is) {
                try {
                    is.close();
                } catch (Exception e) {
                    //Can't do anything
                }
            }
        }
    }



Above code is working fine for all jpeg, Png, and bmp images.

But is giving OutofMemoryException for Gif images of Size 5MB or more.

Has anybody seen this problem. Is there any solution to it?

Thanks,
With Regards /
muniraju
Freshman
Freshman
 
Posts: 5
Joined: Fri Nov 21, 2008 8:53 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 7 guests