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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:58:08+00:00 2026-05-13T19:58:08+00:00

I am using the following code to save a frame of a movie to

  • 0

I am using the following code to save a frame of a movie to my desktop:

NSCIImageRep *imageRep = [NSCIImageRep imageRepWithCIImage:[CIImage imageWithCVImageBuffer:imageBuffer]];
NSImage *image = [[[NSImage alloc] initWithSize:[imageRep size]] autorelease];
[image addRepresentation:imageRep];
CVBufferRelease(imageBuffer);

NSArray *representations = [image representations];
NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations usingType:NSJPEGFileType properties:nil];
[bitmapData writeToFile:@"/Users/ricky/Desktop/MyImage.jpeg" atomically:YES];

At the second last line of code, I receive the following messages in the console, with no result being saved to the desktop:

<Error>: CGImageDestinationFinalize image destination does not have enough images
CGImageDestinationFinalize failed for output type 'public.jpeg'

The NSImage is still an allocated object for the entire method call, so I’m not sure why I am receiving complaints about insufficient amount of images.

I’d appreciate any help.
Thanks in advance,
Ricky.

  • 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-13T19:58:08+00:00Added an answer on May 13, 2026 at 7:58 pm

    I think the source of the problem is that you’re passing an array of NSCIImageRep objects to representationOfImageRepsInArray:usingType:properties:, which I believe expects an array of NSBitmapImageRep objects.

    What you want to do is create an NSBitmapImageRep from your CIImage. Then you can use that to write to disk. That would be roughly:

    CIImage *myImage = [CIImage imageWithCVImageBuffer:imageBuffer]; 
    NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCIImage:myImage];
    NSData *jpegData [bitmapRep representationUsingType:NSJPEGFileType properties:nil];
    [jpegData writeToFile:@"/Users/ricky/Desktop/MyImage.jpeg" atomically:YES];
    

    Of course, you’d want to handle any error cases and probably pass a properties dictionary to fine-tune the JPEG creation.

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

Sidebar

Related Questions

I am using the following code to save an image created on a Form
i am using following code to draw canvas and save it as png image
I am using the following code to save an object and all its properties
I am using the following code to save values from a settings view that
I am using the following line of code to save my file of yoyo.txt
I am trying to save images using the following code: - (void)writeData{ if(cacheFileName==nil) return;
I am using the following lines of code to download and save an html
I'm using following code to save the downloaded file to iphone/ipod-touch's documents directory. NSArray
I am using the following code to save hashmap content into arraylist. HashMap jediSaber
iOS beginner here. I'm using the following code to save my facebook accessToken and

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.