title: Error when compressing jpeg data using
body: <p>I get the following error when trying to compress some jpeg data using <code>UIImageJPEGRepresentation(image, 0.5f);</code></p>
  
  <pre><code>&lt;Error&gt;: Unsupported pixel description - 4 components, 8 bits-per-component, 32 bits-per-pixel
  &lt;Error&gt;: CGBitmapContextCreateWithDictionary: failed to create delegate.
  &lt;Error&gt;: CGImageDestinationAddImage image could not be converted to destination format.
  &lt;Error&gt;: CGImageDestinationFinalize image destination does not have enough images
  </code></pre>
  
  <p>Here is the code snippet where I download and compress the data...</p>
  
  <pre><code>ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:object.largeimage]];
  [request startSynchronous];
  
  NSData *imageData = [request responseData];
  
  UIImage *image = [[UIImage alloc] initWithData:imageData];
  NSData *compressedImageData = UIImageJPEGRepresentation(image, 0.5f);
  
  //If the data was compressed properly...
  if(compressedImageData) [compressedImageData writeToFile:filePath atomically:YES];
  
  //If it wasn't...
  else [imageData writeToFile:filePath atomically:YES];
  
  [image release];
  
  if(request.responseStatusCode == 200)
  object.fullImageFilename = filePath;
  
  [request release];
  </code></pre>
  
  <p>[request release];</p>
  
  <p>Thanks in advance for any help :)</p>