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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:21:35+00:00 2026-06-02T08:21:35+00:00

I have the following code below. Firstly, in the table detail view, i capture

  • 0

I have the following code below. Firstly, in the table detail view, i capture or load a image(the size of the image is about 1/4 of the screen), then after saving the image will be shown at the UITableView. Everything seems going well so far. However, when i press the UITable and try to load the detail page again. The resolution of the image becomes lowered. I guess is the same size as the one at the TableView. May I know what can i do in order to fix this problem?

Thanks.

    -(void) ViewDidLoad{
       if ([currentPicture smallPicture])
                [imageField setImage:[UIImage imageWithData:[currentPicture smallPicture]]];
    }

- (IBAction)editSaveButtonPressed:(id)sender
            {

            // If we are adding a new picture (because we didnt pass one from the table) then create an entry
                if (!currentPicture)
                    self.currentPicture = (Pictures *)[NSEntityDescription insertNewObjectForEntityForName:@"Pictures" inManagedObjectContext:self.managedObjectContext];

        if (imageField.image)
        // Resize and save a smaller version for the table
                    float resize = 74.0;
                    float actualWidth = imageField.image.size.width;
                    float actualHeight = imageField.image.size.height;
                    float divBy, newWidth, newHeight;
                    if (actualWidth > actualHeight) {
                        divBy = (actualWidth / resize);
                        newWidth = resize;
                        newHeight = (actualHeight / divBy);
                    } else {
                        divBy = (actualHeight / resize);
                        newWidth = (actualWidth / divBy);
                        newHeight = resize;
                    }
                    CGRect rect = CGRectMake(0.0, 0.0, newWidth, newHeight);
                    UIGraphicsBeginImageContext(rect.size);
                    [imageField.image drawInRect:rect];
                    UIImage *smallImage = UIGraphicsGetImageFromCurrentImageContext();
                    UIGraphicsEndImageContext();

                    // Save the small image version
                    NSData *smallImageData = UIImageJPEGRepresentation(smallImage, 1.0);
                    [self.currentPicture setSmallPicture:smallImageData];
                }
  • 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-02T08:21:37+00:00Added an answer on June 2, 2026 at 8:21 am

    [enter link description here][1]Change this line( NSData *smallImageData = UIImageJPEGRepresentation(smallImage, 1.0); ) by following line..

    NSData *smallImageData = UIImageJPEGRepresentation(smallImage, 0.0);
    

    or

    NSData *smallImageData = UIImagePNGRepresentation(smallImage);
    

    Hope,this will help you..

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

Sidebar

Related Questions

i have the following code below: const char* timeformat = %Y-%m-%d %H:%M:%S; const int
I want to know is below code correct ? I have following code which
I have the following C# code below. Object first = 5; Object second =
i have the following code: <h3> Your Profile </h3> The information below is what
i have the following code below but sometime the serving_description tag isn't there. Right
I have the following code below: BEGIN TRY BEGIN TRANSACTION -- DO SOMETHIING COMMIT
See i have this following code below, at line no.9 i'm calculating some dates
I have the following *code below, every time I refresh the page it asks
I have the following code below on my website. It's used to find the
hi i have the following code below, where i try to get all the

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.