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 7566755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:29:40+00:00 2026-05-30T14:29:40+00:00

I have been struggling with this issue for some days now and I really

  • 0

I have been struggling with this issue for some days now and I really don’t know what is the problem.
My CameraView class has the following code:

Camera.PictureCallback photoCallback = new Camera.PictureCallback() {
    public void onPictureTaken(byte[] imageData, Camera camera) {
        Intent mIntent = new Intent();  
        mIntent.putExtra(GeneralCodes.CREATE_NEW_ACCOUNT_PROFILE_PICTURE, imageData);
        setResult(Activity.RESULT_OK, mIntent);
        finish();
    }
};

And then, my Activity that receives this result:

ImageView i = (ImageView) findViewById(R.id.createAccounProfileImage);
Bitmap yourSelectedImage = FileUtilities.createBitmapBasedOnByteImage(data.getByteArrayExtra(GeneralCodes.CREATE_NEW_ACCOUNT_PROFILE_PICTURE), getResources().getDisplayMetrics().density);

finalImage=yourSelectedImage;
            i.setImageBitmap(BitmapUtils.getRoundedCornerBitmap(finalImage, Math.min(finalImage.getWidth(), finalImage.getHeight()), true));        

The only thing the method FileUtilities.createBitmapBasedOnByteImage is really doing is just a BitmapFactory.decodeByteArray() call.

Then, my next step is sending this Bitmap to my server:

ByteArrayOutputStream baos = new ByteArrayOutputStream();
    if(finalImage!=null)finalImage.compress(Bitmap.CompressFormat.JPEG, 0, baos);
    byte[] data = baos.toByteArray();

    pairs.add(new BasicNameValuePair("PROFILE_PIC_DATA", Base64.encodeToString(data, Base64.DEFAULT)));     

The information is sent to my server and image is persisted in the CLOB.
When my next acticity retrieves this data:

bitmap = BitmapFactory.decodeStream(createInputStream(Base64.decode(obj.getString("photo_image"), Base64.DEFAULT)));

The quality is completely messed up. Like it was taken by a 0.3mpx camera.
I am using Samsung Galaxy Nexus, so I believe that my screen is contributing to make it worse. The images have around 2.7kb size in the CLOB… so I am guessing data is being lost when sending to my server… Am not really sure.

Anyone ever seen this?

THanks,
Felipe

  • 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-05-30T14:29:43+00:00Added an answer on May 30, 2026 at 2:29 pm

    You’re setting image quality to 0 when compressing. Instead set it to something bigger. See the docs. Something like:

    if(finalImage!=null)finalImage.compress(Bitmap.CompressFormat.JPEG, 80, baos);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been struggling with this problem for a few days now and I
I've been struggling with this issue for a while now. I have OpenCart 1.5.2.1
I've been struggling with this issue for a couple of days now. I need
I have been struggling with this issue for 3 hours. I know I can
I have been struggling with this issue for a few hours now without understanding
I am having this issue I have been struggling with for sometime and now
I have been struggling with this issue for weeks now. Anyway, CALayer's are awful.
I'm new with ruby and rails and have been struggling with this issue for
I have been struggling with this for a while now. given a set of
I have been struggling with this question for awhile now, and I haven't reached

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.