If you can get the width and height for the image without completely opening it, then use the width*height*depth.
You probably have to use this option: http://developer.android.com/intl/de/reference/android/graphics/BitmapFactory.Options.html#inJustDecodeBounds Nathan On Jul 23, 9:30 am, ReyLith <[email protected]> wrote: > So, how can I obtain the depth for know if I can work with the image? > > On 23 jul, 18:18, DanH <[email protected]> wrote: > > > > > The size of an image file depends greatly on the compression > > techniques used to create it. Virtually all image formats involve > > some sort of compression such that the total number of bits in the > > file is considerably less than the (width * height * depth) number > > that represents the raw image. > > > On Jul 23, 7:27 am, ReyLith <[email protected]> wrote: > > > > Hi again, > > > > I'm trying to put a message when the image is so big. For this I think > > > to obtain the size of the file and compare it with the free memory > > > Runtime.getRuntime().getFreeMemory()). It works well but I have a new > > > problem. The application show an error message with some images > > > because they are so big and the application dont't detect the problem. > > > I research in other posts and the problem is that the file size is > > > different from the size of the image in memory. To get the size of the > > > image in memory I use the product getHeight () * getRowBytes () of the > > > Bitmap class, but with some images not previously had problems, I get > > > very large sizes, so often I get the message erroneously. > > > > Does anyone know how could solve this problem? > > > > Thank you very much in advance. -- 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

