Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8182875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:59:22+00:00 2026-06-07T00:59:22+00:00

I have searched for this, and i found that for api less than 12,

  • 0

I have searched for this, and i found that for api less than 12, usually what is used is bitmap.getrowbytes * bitmap.getheight;

However, for an image i am obtaining the following:

mBitmap.getRowBytes() = 320
mBitmap.getHeight() = 100
mBitmap.getWidth() = 80.

Thus according to the above formula I get 32,000.

However when i check the file that i m reading the bitmap image from from adb using

ls -l

I get that the size is 90Kb.

I am reading the image as follows:

        Uri chosenImageUri = data.getData();
        if (chosenImageUri != null) {
            try {
       InputStream photoStream = getContentResolver().openInputStream(chosenImageUri);
          BitmapFactory.Options opts = new BitmapFactory.Options(); 
              opts.inSampleSize = 4;
              Bitmap mBitmap = BitmapFactory.decodeStream(photoStream,null, opts);
          photoStream.close();

} 
}

Why are the results different? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:59:23+00:00Added an answer on June 7, 2026 at 12:59 am

    Ok I just understood what’s going on. I will post this in case it helps anyone.

    The reason of this is that I am using bitmapfactoryoptons along with insamplesize =4.

    What happens is

    For example, inSampleSize == 4 returns an image that is 1/4 the width/height of the original, and 1/16 the number of pixels. Any value <= 1 is treated the same as 1.

    as mentioned here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched the googles for this and have found that you use extern
I searched for an implementation of std::map runtime ordering and have found this solution:
Okay, so I have searched this site and found many tutorials on how to
I have searched all night and haven't found anything that I can use on
I have searched on this and found something about using remotely hosted JSPs but
I have searched on Google and found that I have to use AT commands
I've searched this for a while and haven't found anything answered anywhere: I have
I have searched this site top to bottom yet have not found a single
I have searched and found surprisingly few results. I found that there is some
I have searched this topic on google a bit and seen some best practices.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.