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

  • Home
  • SEARCH
  • 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 7972931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:58:47+00:00 2026-06-04T07:58:47+00:00

I’ve been searching this forum up and down but I couldn’t find what I

  • 0

I’ve been searching this forum up and down but I couldn’t find what I really need. I want to get raw image data from the camera. Up till now I tried to get the data out of the imageDataSampleBuffer from that method captureStillImageAsynchronouslyFromConnection:completionHandler: and to write it to an NSData object, but that didn’t work.
Maybe I’m on the wrong track or maybe I’m just doing it wrong.
What I don’t want is for the image to be compressed in any way.

The easy way is to use jpegStillImageNSDataRepresentation: from AVCaptureStillImageOutput, but like I said I don’t want it to be compressed.

Thanks!

  • 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-04T07:58:48+00:00Added an answer on June 4, 2026 at 7:58 am

    This is how i do it:

    1: I first open the camera using:

    - (void)openCamera
    {
        imagePicker = [[UIImagePickerController alloc] init];
        imagePicker.delegate = self;
    
        if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
        {        
            imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
            imagePicker.mediaTypes = [NSArray arrayWithObjects:
                                  (NSString *) kUTTypeImage,
                                  (NSString *) kUTTypeMovie, nil];
            imagePicker.allowsEditing = NO;
    
            [self presentModalViewController:imagePicker animated:YES];
        }
        else {
            lblError.text = NSLocalizedStringFromTable(@"noCameraFound", @"Errors", @"");  
        }
    }
    

    When the picture is taken this method gets called:

     -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
        // Save and get the path of the image
        NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        if([mediaType isEqualToString:(NSString *)kUTTypeImage]) 
        {
            // Save the image
            image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
            [library writeImageToSavedPhotosAlbum:[image CGImage] orientation:(ALAssetOrientation)[image imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error){
                if(!error) {
                   //Save path and location to database
                   NSString *pathLocation = [[NSString alloc] initWithFormat:@"%@", assetURL];
                } else {
                    NSLog(@"CameraViewController: Error on saving image : %@ {imagePickerController}", error);
                }
            }];
    
        }
        [imagePicker dismissModalViewControllerAnimated:YES];
    }
    

    Then with that path i get the picture from the library in FULL resolution (using the “1”):

     -(void)preparePicture: (NSString *) filePathPicture{
        ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset *myasset)
        {
            if(myasset != nil){
                ALAssetRepresentation *assetRep = [myasset defaultRepresentation];
                CGImageRef imageRef = [assetRep fullResolutionImage];
                if (imageRef) {
                    NSData *imageData = UIImageJPEGRepresentation([UIImage imageWithCGImage:imageRef], 1);
                }
            }else {
                //error
            }
         };
    
        ALAssetsLibraryAccessFailureBlock failureBlock  = ^(NSError *error)
        {      
             NSString *errorString = [NSString stringWithFormat:@"can't get image, %@",[error localizedDescription]];
            NSLog(@"%@", errorString);
        };
    
         if(filePathPicture && [filePathPicture length])
         {
             NSURL *assetUrl = [NSURL URLWithString:filePathPicture];
             ALAssetsLibrary *assetslibrary = [[ALAssetsLibrary alloc] init];
            [assetslibrary assetForURL:assetUrl 
                       resultBlock:resultBlock
                      failureBlock:failureBlock];
        }
    }
    

    Hope this helps you a bit further :-).

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to construct a data frame in an Rcpp function, but when I
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't

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.